Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Memory usage of a java application
- From: ubertyp@xxxxxxxxxxx (ubertyp@xxxxxxxxxxx)
- Subject: Memory usage of a java application
- Date: Tue, 28 Dec 1999 13:28:54 PST
The answer is... pinning. The actual 'Java' heap size may be 3 meg - that means that if you were to add up the individual sizes of all the objects you have allocated, you'd have 3 meg - but that doesn't mean the native heap size will be three meg. There's lots of empty space in the native heap, and it's space that quite often can't be reclaimed easily because of pinning. Under ordinary circumstances, the garbage collector will compact the heap to reclaim extra space whenver it can, but this obviously requires objects to be moved. The problem is that sometimes there are native pointers (within JNI stuff, peers, etc) that point at the java objects directly. You can't just go moving those objects all willy-nilly, since the pointers will be invalidated. So, any object that the garbage collector thinks might have a pointer pointed at it won't get moved, and that means heap compaction can only go so far, and that means that the native heap size gets a lot bigger than the java heap size. Try this for kicks: Run the app, watching your heap size. Now minimize the window... Weird enough for you? Maximize it, then use the app. Windows NT does its own heap compaction - you can do that if you do address translation, which it does. >Hello All, >I am in a process of measuring the memory usage of a RMI based java >application on Windows NT Server 4.0 and JDK 1.1.6. >I have started the application with 32MB of minimum heap memory and 64 MB >of >maximumum memory. >At the application startup Windows NT task mamager shows 10MB of memory >utilization for the JVM associated with this RMI >application. And the Runtime.usedMemory() returns 2 MB. As a user connectes >task manager memory usage increases substantially to >16 MB(NT virtual memory size = 38MB), However JVM Runtime.usedMemory() >returns >3 MB of heap memory used. >Can anyone please explain me how to relate the JVM's heap memory usage with >the Windows task managers' memory usage data. >why does NT task manager memory increases by such a huge amount. > >Thanks in advance. >Pradeep > > >--- >To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx >To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com --- To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Prev by Date: Microsoft DirectX and Java ??
- Next by Date: Printing a Report from Java
- Previous by thread: servlet problem
- Next by thread: Printing a Report from Java
- Index(es):