memsup:get_memory_usage() on leopard

ngocdaothanh ngocdaothanh@REDACTED
Tue Oct 13 09:38:13 CEST 2009


Thank you for this patch.

As "{unix,darwin}" implies, with the original code, there is error
starting os_mon on Leopard, but no problem on Linux.


On Sep 25, 1:07 am, Joel Reymont <joe...@REDACTED> wrote:
> Does not work and prevents the os_mon app from starting. Here's a
> patch...
>
> diff --git a/memsup.erl b/memsup.erl
> index 4e4eff0..f9ad44e 100644
> --- a/memsup.erl
> +++ b/memsup.erl
> @@ -728,8 +728,10 @@ get_memory_usage({unix,darwin}) ->
>          io_lib:fread("Pages active:~d.", skip_to_eol(Str2)),
>       {ok, [Inactive],Str4} =
>          io_lib:fread("Pages inactive:~d.", skip_to_eol(Str3)),
> +    {ok, _,Str5} =
> +       io_lib:fread("Pages speculative:~d.", skip_to_eol(Str4)),
>       {ok, [Wired],_} =
> -       io_lib:fread("Pages wired down:~d.", skip_to_eol(Str4)),
> +       io_lib:fread("Pages wired down:~d.", skip_to_eol(Str5)),
>       NMemUsed  = (Wired + Active + Inactive) * 4000,
>       NMemTotal = NMemUsed + Free * 4000,
>       {NMemUsed,NMemTotal};
>
> ---
> fastest mac firefox!http://wagerlabs.com
>
> ________________________________________________________________
> erlang-questions mailing list. Seehttp://www.erlang.org/faq.html
> erlang-questions (at) erlang.org


More information about the erlang-questions mailing list