title: Java Linux VIRT size is high
body: <p>Currently, I have developed a Java application, and it runs under JDK 1.7, when I deployed this application on Linux and used command <em>top</em> to monitor it, I found that the VIRT is so high, please see following,</p>
  
  <pre><code>  PID USER PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    65044 app  20   0 31.5g 418m  13m S  0.0  0.1   0:55.17 java  
  </code></pre>
  
  <p>It takes around 31.5 GB.</p>
  
  <p>And I also used the pmap -x to look into further, here is the details,</p>
  
  <pre><code>Address           Kbytes     RSS   Dirty Mode   Mapping
  0000000000400000       4       4       0 r-x--  java
  0000000000600000       4       4       4 rw---  java
  0000000000910000    6544    6544    6544 rw---    [ anon ]
  0000000080000000   41472   41324   41324 rw---    [ anon ]
  0000000082880000   42496       0       0 rw---    [ anon ]
  0000000085200000 1397760      76      76 rw---    [ anon ]
  00000000da700000 19517440       0       0 rw---    [ anon ]
  0000000581b00000 1224704  322816  322816 rw---    [ anon ]
  00000005cc700000 9233408       0       0 rw---    [ anon ]
  0000003895600000     128     116       0 r-x--  ld-2.12.so
  000000389581f000       8       8       8 r----  ld-2.12.so
  0000003895821000       4       4       4 rw---  ld-2.12.so
  0000003895822000       4       4       4 rw---    [ anon ]
  0000003895a00000    1576     616       0 r-x--  libc-2.12.so
  0000003895b8a000    2048       0       0 -----  libc-2.12.so
  0000003895d8a000      16      16       8 r----  libc-2.12.so
  0000003895d8e000       8       8       8 rw---  libc-2.12.so
  0000003895d90000      16      12      12 rw---    [ anon ]
  0000003895e00000      92      72       0 r-x--  libpthread-2.12.so
  0000003895e17000    2048       0       0 -----  libpthread-2.12.so
  0000003896017000       4       4       4 r----  libpthread-2.12.so
  0000003896018000       4       4       4 rw---  libpthread-2.12.so
  0000003896019000      16       4       4 rw---    [ anon ]
  0000003896200000       8       8       0 r-x--  libdl-2.12.so
  0000003896202000    2048       0       0 -----  libdl-2.12.so
  0000003896402000       4       4       4 r----  libdl-2.12.so
  0000003896403000       4       4       4 rw---  libdl-2.12.so
  0000003896600000      28      20       0 r-x--  librt-2.12.so
  0000003896607000    2044       0       0 -----  librt-2.12.so
  0000003896806000       4       4       4 r----  librt-2.12.so
  0000003896807000       4       4       4 rw---  librt-2.12.so
  0000003896a00000     524      52       0 r-x--  libm-2.12.so
  0000003896a83000    2044       0       0 -----  libm-2.12.so
  0000003896c82000       4       4       4 r----  libm-2.12.so
  0000003896c83000       4       4       4 rw---  libm-2.12.so
  0000003899a00000      88      16       0 r-x--  libgcc_s-4.4.7-20120601.so.1
  0000003899a16000    2044       0       0 -----  libgcc_s-4.4.7-20120601.so.1
  0000003899c15000       4       4       4 rw---  libgcc_s-4.4.7-20120601.so.1
  </code></pre>
  
  <p>My application is indeed a multiple thread application, but It only has 3 when starting up.</p>
  
  <p>And after the startup, I found that the VIRT is growing to 31.5 GB, especially for address 00000000da700000, it takes around 20 GB.</p>
  
  <p>Anyone who have the ideas? thanks.</p>