measure memory consumption in an Erlang system?
Memory consumption is a bit of a tricky issue in Erlang. Usually, you don’t need to worry about it because the garbage collector looks after memory management for you. But, when things go wrong, there are several sources of information. Starting from the most general: Some operating systems provide detailed information about process memory use with tools like top, ps or the linux /proc filesystem: cat /proc/5898/status VmSize: 7660 kB VmLck: 0 kB VmRSS: 5408 kB VmData: 4204 kB VmStk: 20 kB VmExe: 576 kB VmLib: 2032 kB This gives you a rock-solid upper-bound on the amount of memory the entire Erlang system is using. erlang:system_info reports interesting things about some globally allocated structures in bytes: 3> erlang:system_info(allocated_areas). [{static,390265}, {atom_space,65544,49097}, {binary,13866}, {atom_table,30885}, {module_table,944}, {export_table,16064}, {register_table,240}, {loaded_code,1456353}, {process_desc,16560,15732}, {table_desc,1120,1008}, {link_desc,6480,5688}