Need help on memory usage VS PF usage

M

metfan

Gurus,

I wrote a web testing tool, it uses the HttpUnit to simulate
the actions of surfing the net according to some preconfiged
scripts. The problem is that my program seems has a memory leak bug,
if I keep it running long enough, it finally runs into
OutOfMemoryError. When it's running, I open the 'task manager'
(Under windows)
and from the 'performance' tab I notice that the 'PF Usage'
keeps growing, but from the 'processes' tab, the 'memory usage' of
my program(javaw.exe) stays in a range(20M - 70M). Even after
a long time running and 'PF Usage' reaches a very high point and
finally
out of memory, the 'memory usage' generally stays at 50M. I'm going
to
try some profiler but first could someone please explain what's the
difference between 'memeory usage' and 'PF Usage' and why one keeps
growing
while the other doesn't? And, possiblly, some basic on the Java
Memory Model?

Thanks.
 
M

Michael Borgwardt

metfan said:
and from the 'performance' tab I notice that the 'PF Usage'
keeps growing, but from the 'processes' tab, the 'memory usage' of
my program(javaw.exe) stays in a range(20M - 70M). Even after
a long time running and 'PF Usage' reaches a very high point and
finally
out of memory, the 'memory usage' generally stays at 50M. I'm
going to
try some profiler but first could someone please explain what's the
difference between 'memeory usage' and 'PF Usage' and why one
keeps growing
while the other doesn't?

That's absolutely normal. "PF" is the paging file, i.e. an area on the
harddisk to which unused parts of the RAM's content can be "paged out"
in order to simulate more memory than the machine actually has; this
is called "virtual memory".
"memory usage" is the actual RAM the process is using. A memory
leak typically creates lots of data that is not used but not freed
either, so it gets paged out when the physical RAM is insufficient.
And, possiblly, some basic on the Java
Memory Model?

There's enough books and websites that explain it and also the
concept of virtual memory, which you're apparently unfamiliar with.

As for the memory leak itself, your best chance at finding it is
by using something called a "profiler".
 
R

Robert Olofsson

metfan (qjzhupublic@___NoSpam__yahoo.ie) wrote:
: Gurus,
: scripts. The problem is that my program seems has a memory leak bug,
: if I keep it running long enough, it finally runs into
: OutOfMemoryError.

Ok, I would suggest that you use a profiler then.

: try some profiler but first could someone please explain what's the
: difference between 'memeory usage' and 'PF Usage' and why one keeps
: growing
: while the other doesn't? And, possiblly, some basic on the Java
: Memory Model?

One guess is that you do not close all streams/files and some jvms tend to
throw OOME when to many files are open...

/robo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,247
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top