Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a JBoss application running on linux platform, it has top output like below(not accurate data actually):

 1379 root      16   0  9.7g 1.6g 1980 S  0.7  1.3 36  9.7g 0:11.03 java

it has 1.6g physical memory totally, and has 9.7g DATA part. actually the heap size is ~128m as configured with JVM. my question is what is DATA part storing for java application? any clue? and how could I optimize it?

thanks, Emre

share|improve this question

migrated from May 10 '12 at 13:46

This question came from our site for professional and enthusiast programmers.

You can't do it by yourself, but once five people vote for it to be moved there, it'll happen automatically (more or less). Alternatively, register for that forum and re-post there. – Aleks G May 8 '12 at 16:25
up vote 1 down vote accepted

DATA means memory allocated by the application using brk(2) - i.e. extending the data segment.

Java has a lot of different things it will put into the data segment:

  • The heap
  • Any memory allocated by the native runtime layer (code using the native keyword)
  • Any memory allocated by DLLs/shared libraries you load from Java using JNI/JNA
  • Memory where byte code is loaded, interpreted and compiled by the JIT (code cache)
  • Memory structures used by the GC and other runtime support code
  • The stack

Note that giving a program 128MB heap will allocate more than that because Java will also create some structures to manage the heap which are not part of it. So 128MB means that you will have 128MB in which you can allocate Java objects.

share|improve this answer
Thanks Aaron for your detailed info! so you mean the DATA part(by Top output) will almost includes all java application needed memory space? includes Heap, Stack and external loaded libraries. and do you have any recommendation tools to analyze inside DATA part? i think JProfiler or JProbe will only analyze heap part, it will not helpful, right? – Emre He May 8 '12 at 16:38
I'm not aware of a tool that can do further analysis but I'm not an expert in the area. I suggest you ask a new, more specific question like "My app has 128MB heap but uses 1.6GB of real RAM. How can I find out where the 1.4GB go to?" – Aaron Digulla May 9 '12 at 8:03
Finally we found it is caused by .so file load by JNI, it take more memories. thanks for your help. – Emre He Jun 2 '12 at 8:32

This is the amount of physical memory devoted to other than executable code, also known as the 'data resident set' size or DRS. Generally, you can refer to a manual page that describes all columns in details. To get a manual page, type man top.

share|improve this answer
Thanks firstly. i can see from Top manual as "DATA -- Data+Stack size (kb)", i mean what's this DATA meaning? maybe it is according to java static variables or String definition? – Emre He May 8 '12 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .