How to get the memory usage for the system in Erlang?

Gunilla Arendt gunilla@REDACTED
Wed Jun 7 10:20:53 CEST 2006


$ erl -sname one
..
1> application:start(sasl).
...
ok
2> application:start(os_mon).
...
ok
3> memsup:get_system_memory_data().
[{system_total_memory,1073741824},
  {free_memory,503242752},
  {total_memory,1073741824}]
4>

/ Gunilla


Tony Zheng wrote:
> Hi
> I want to check the memory usage(the amount of free memory available)
> for the system in Erlang on Unix platform(Sun Solarix 10). I used
> memsup:get_memory_data() or memsup:get_system_memory_data() command to
> do it. But both of them gave an error message. Are there any suggestions
> for that? Thanks.
>  
> $ erl -sname one
> Erlang (BEAM) emulator version 5.4.12 [source] [hipe]
> Eshell V5.4.12  (abort with ^G)
> (one@REDACTED)1> memsup:get_memory_data().
> ** exited: {noproc,{gen_server,call,[memsup,get_memory_data,infinity]}}
> **
> (one@REDACTED)2> memsup:get_system_memory_data().
> ** exited:
> {noproc,{gen_server,call,[memsup,get_system_memory_data,infinity]}} **
> 
> tony
> 
> 



More information about the erlang-questions mailing list