Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Memory explained (SUN JVM)

I tried to find an interpretation of the memory segments of the sun java vm, which would also be understandable by an administrator. It should explain what heap / non-heap memory is and the significance of the different memory pools.

If it would somehow relate to the jconsole view, it would be a bonus.

Is there somewhere a website with such an explanation?

like image 758
Mauli Avatar asked May 13 '09 14:05

Mauli


People also ask

What is JVM and explain me the Java memory allocation?

Java Memory Structure: JVM defines various run time data area which are used during execution of a program. Some of the areas are created by the JVM whereas some are created by the threads that are used in a program. However, the memory area created by JVM is destroyed only when the JVM exits.

How is JVM memory allocated?

JVMs allocate memory on an as needed basis from the operating system. Generally, when the JVM starts, it will allocate the minimum memory allocated (Xms) to the application that is running. As the application requires more memory, it will allocate blocks of memory until the maximum allocation (Xmx) has been reach.

How much memory does JVM take?

The JVM has a default setting of 1/4 of main memory. If you have 4 GB it will default to 1 GB. Note: this is a pretty small system and you get get some embedded devices and phones which this much memory. If you can afford to buy a little more memory it will make your life easier.

What is the JVM memory model and how does it work?

JVM Memory Structure. JVM creates various run time data areas in a heap. These areas are used during the program execution. The memory areas are destroyed when JVM exits, whereas the data areas are destroyed when the thread exits.


1 Answers

Here's a list of resources I had noted down. Some of these explain how the heap/garbage collection works and some have details on how to configure everything.

IBM

  • How does garbage collection work?
  • Detailed description of garbage collection
  • Generational and concurrent garbage collection

Sun

  • Turbo-charging Java HotSpot Virtual Machine, v1.4.x to Improve the Performance and Scalability of Application Servers - (discussion of low pause collectors)
  • Performance Documentation for the Java HotSpot VM
  • Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1
  • Frequently Asked Questions About the Java HotSpot VM
  • Java HotSpot VM Options

Other

  • Java Specialists newsletter
    • Articles on performance
    • Determining memory usage in Java
  • Java Performance Tuning web site
  • Java World - Pick up performance with generational garbage collection
  • DZone - How to tame Java GC Pauses
like image 102
A_M Avatar answered Oct 17 '22 08:10

A_M