- The memory that a vm uses is never decreasing (At least I don't 
  know any that behave that way)
  To understand that you have to see two different things:
  - the memory that is used by the vm
  - the memory inside the vm 
  All vm's that I know, don't return memory to the os. What
  happens during a gc is just that inside the vm the memory is 
  marked as free. So the only save indicators for the question
  'how many memory is currently in use' are the methods
  java.lang.Runtime.get*Memory.
- To a certain degree it is normal that the memory is increasing.
  Reasons for that:
  - each session needs some memory, that is only released after
    the session has timed out. If you create sessions very fast
    this can consume quite some memory. (If you are creating
    the sessions faster as they dye tomcat will die with an out 
    of memory error.)
  - Just because an object isn't used anymore , is dosn't mean 
    that the memory that is consumed by it is freed. This just 
    happens, when the garbage collector runs. When this will 
    happen, is up to the VM. Until then the memory will grow.
    There is nothing you (or tomcat) can do about that from 
    inside the application. The only action that has affect, 
    is to play with the various parameters for the garbage 
    collector as argument to the java process.

So what can you do, to track the problem down:
- Make shure that the request don't create new sessions.
  (There are several routes how to achieve that)
- Strip the page that you test down to a minmal jsp.
  (I haven't seen in your previous posts that
   you say anything about the nature of this page)
- Track the memory usage with java.lang.Runtime.get*Memory()
- Use the java options to achieve a verbose gc
- Set the maximal heap size to a lower bound, to see
  what happens when this value is reached.
- Profile the application with OptimizeIt or jProbe
  or any other profiler.
- show us your page, maybe it's the page that contains the 
  memory leak

Sun has some background and advice at:
http://java.sun.com/docs/hotspot/gc/
http://java.sun.com/products/hotspot/whitepaper.html

Also javaworld:
http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html


Ralph Einfeldt
Uptime Internet Solution Center GmbH
Hamburg, Germany
Hosting, Content Management, Java Consulting
http://www.uptime-isc.de 

> -----Urspr�ngliche Nachricht-----
> Von: Ing. Damiano Bolla [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 27. September 2002 16:13
> An: Tomcat Users List
> Betreff: RE: Tomcat 4.1.12 memory leak, resources leak, what to do ?
> 
> 
> Yes, I did let it run and it keeps eating.
>
> As far as I see this IS a problem.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to