1 Reply Latest reply on Sep 3, 2009 6:50 PM by 843829

    java heap - real size virtual size

      Java allocates maximum memory size at the begining of execution. But if you see with 'top' command for example, you can check that real memory size used by java aplication is usually lower. Is java real memory size non-decreasing? Does Java free Real memory at any point? Any place to find more information about it.

      Another question, how does JVM manages internal structures when resizing real memory size? I'd like to know it with maximum detail. Java heap is divided in three regions, perm, old and new generations. Is each generation allocated in contiguous memory?

        • 1. Re: java heap - real size virtual size
          I don't know what the "top" command is and I don't know what operating system you're on, but let me tell you how it works on Windows.

          The VM gets a contiguous piece of address space at start up. That's very different from memory (working set, page file space, etc.).

          Yes, it does give memory back. If you look at the java-tool documentation and follow the links to the non-standard options (they're hard to find. There's the -X non-standard options and the -XX very non standard option; they're where the action is) you'll find some that control when the VM/gc gives back memory.