Need help on memory usage VS PF usage

Discussion in 'Java' started by metfan, Oct 21, 2003.

  1. metfan

    metfan Guest

    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.
    metfan, Oct 21, 2003
    #1
    1. Advertising

  2. metfan wrote:
    > 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".
    Michael Borgwardt, Oct 21, 2003
    #2
    1. Advertising

  3. 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
    Robert Olofsson, Oct 21, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin
    Replies:
    7
    Views:
    542
    Stephen Kellett
    Dec 19, 2005
  2. hvt
    Replies:
    0
    Views:
    1,206
  3. hvt
    Replies:
    0
    Views:
    1,463
  4. Krist
    Replies:
    8
    Views:
    6,422
    Arne Vajhøj
    Feb 10, 2010
  5. MrsEntity
    Replies:
    20
    Views:
    474
Loading...

Share This Page