|
From: Hubert F. <hub...@ab...> - 2007-01-31 12:53:46
|
Hey Leif,
...and if you think you know them all, there is still one more feature
:-)
I' ll play with it, thank you very much
Regards
Hubert
>>> Leif Mortenson <le...@ta...> 30.01.2007 19:41 >>>
Hubert,
The Wrapper doesn't do anything itself but the JVM has support for
this.
Take a look at the java.lang.Runtime class. You will find the
freeMemory(),
maxMemory(), and totalMemory() methods. totalMemory() is the amount
of allocated memory. To find out how much is actually being used, do
this
inUseMemory = rt.totalMemory() - rt.freeMemory();
Note that those two calls are NOT synchronized. If a memory
allocation
is made at the right moment, it may be possible to get strange values
for inUseMemory...
On Windows, the following two properties exist on an experimental
basis
They are not supported and I reserve the right to change them in the
future,
but you might want to try playing around with them. If I can figure
out a
way to do the same thing on UNIX platforms, there are some things I
would like to do with this data. Logging it is not all that
interesting.
wrapper.memory_output=TRUE
wrapper.memory_output.interval=60
Here are the meanings of the output:
log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_STATUS,
"Wrapper memory: %lu, %lu (%lu), %lu (%lu), %lu (%lu), %lu
(%lu) Java memory: %lu, %lu (%lu), %lu (%lu), %lu (%lu), %lu (%lu)",
wCounters.PageFaultCount,
wCounters.WorkingSetSize, wCounters.PeakWorkingSetSize,
wCounters.QuotaPagedPoolUsage,
wCounters.QuotaPeakPagedPoolUsage,
wCounters.QuotaNonPagedPoolUsage,
wCounters.QuotaPeakNonPagedPoolUsage,
wCounters.PagefileUsage, wCounters.PeakPagefileUsage,
jCounters.PageFaultCount,
jCounters.WorkingSetSize, jCounters.PeakWorkingSetSize,
jCounters.QuotaPagedPoolUsage,
jCounters.QuotaPeakPagedPoolUsage,
jCounters.QuotaNonPagedPoolUsage,
jCounters.QuotaPeakNonPagedPoolUsage,
jCounters.PagefileUsage, jCounters.PeakPagefileUsage);
Cheers,
Leif
Hubert Felber wrote:
> Hello,
>
> Is there a way to monitor memory usage of a service other then to
use
> a filter for "OutOfMemory" on the console?
>
> Thank you
> hub
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wrapper-user mailing list
Wra...@li...
https://lists.sourceforge.net/lists/listinfo/wrapper-user
|