memsup:get_memory_usage() on leopard
Joel Reymont
joelr1@REDACTED
Thu Sep 24 18:07:35 CEST 2009
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
More information about the erlang-questions
mailing list