There is some data that is not stored in the heap: - The Stack Each thread has at least one stack. The Sun VM has two stacks per thread. (One for the java code, one for the c code) The size of the java stack is not specied, the size of the c stack is controlled by the option -Xss (the default depends on the underlying OS: typical value between 2 and 16 MB per thread) - Static data - The VM iself
I'm not shure wether classes that are loaded at runtime are stored in the heap. (Never had enough interest in this to look in the java spec) A memory leak is unlikely to explain what you see as the memory leak just increases the heap and not the difference between heap and total memory. Other possible explanations: - The physical memory gets fragmented over time. - In a real bad implementation of a VM it is possible that the size of allocation blocks don't match the size of the os. (e.g. VM grows in 2KB blocks and the os has minimal blocksize of 4KB) > -----Ursprüngliche Nachricht----- > Von: Christophe Reynaud [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 9. April 2002 20:52 > An: Tomcat Users List > Betreff: Tomcat process takes 246M whereas total java heap is 127M > > > Hello, > > We use tomcat 3.3.1 on Linux RH 7.2. JVM : IBM 1.3 > > "top -c" tells that the tomcat threads take 246M but if we > use the Java > function "totalMemory()", it tells that the JVM uses 127M for > the heap. > Where is the rest of memory ? I expected that the JVM used more than > only the total of the heap, but in this case it is almost the double ! > Any ideas about the reasons of this problem ? Are there some momory > leaks in the JVM ? > > Thanks. > > Christophe > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>