I've noticed that the average memory consumption value calculated by
Cartridge Agent is a higher value (70-100%) even when the servers are idle.
While investigating this problem, learnt that Java OperatingSystemMXBean
isn't useful in Linux case, due to the fact that linux kernel caches a
large amount of memory internally. You can notice this using the free
command.
[stratos@414002071406 ~]$ free -m
total used free shared buffers cached
Mem: 7337 7242 94 0 174 5903
-/+ buffers/cache: 1164 6173
Swap: 0 0 0
In the above example, if we use methods in OperatingSystemMXBean API, it'll
give a memory consumption value of 98%. But if you take cached memory into
consideration, the real memory consumption value is 16%.
I'll commit this fix soon.
--
Best Regards,
Nirmal
Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.
Blog: http://nirmalfdo.blogspot.com/