java - -XX:+UseCompressedOops does not work in Eclipse -


my java (64bit) version information below:

d:\workspace\s3-jerome\voice\nlp>java -version java version "1.7.0_09" java(tm) se runtime environment (build 1.7.0_09-b05) java hotspot(tm) 64-bit server vm (build 23.5-b02, mixed mode) 

my application has lot of instances, therefore consumes plenty of memory if each reference occupies 8 bytes. want use -xx:+usecompressedoops force jvm compress oop. in eclipse, have added -xx:+usecompressedoops in vm arguments in run configuration.

but when profile program visualvm 1.3.7, still result size of each reference 8 bytes. instance size of following class still 32!

public class aclinkedlist<e> {     private e element;     private aclinkedlist<e> next;      public aclinkedlist(e element) {        this.element = element;        next = null;     };      ....... } 

anybody knows problem?

  1. usecompressedoops enabled default on hotspot 7 when appropriate (heap size not large).
  2. jvisualvm not take setting account , reports erroneous data.
  3. you can convince of above running trivial java program , measuring heap occupancy runtime.freememory() , runtime.totalmemory().

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -