Continuing with my earlier discussion related to JVM memory management one shortcut adopted by many desperadoes to fix heap thrashes is to increase the max heap space. However, some may not have this luxury as they may be running on 32 bit OS. Others, may be reluctant to increase beyond 1GB thinking it may negatively affect JVM performance. These misconceptions are of the past, with Java5 and Java6, garbage collector which drives JVM memory management can handle up to 1.7GB with 100% efficiency on a Win32 machine (3.2GB on AIX 32-bit) and on a a 64-bit machine heap max is virtually unlimited, albeit with an efficiency of 50-70%. The key to note here is drop in efficiency rate of heap utilization, your JVM will now need 64 bit pointers to access java object reference. For example, an app that runs on 32 bit mode with 3GB heap space will now need 5-6GB heap space when migrated to 64 bit platform, so as to maintain its previous efficiency level.
| Pointer Size | Space | Max Heap | Efficiency |
| 32 bits | 4GB | 1.7GB (Win) | 100% |
| 3.2GB(AIX) | |||
| 64 bits | unlimited | unlimited | 50-70% |
| 64 bits compressed | 4 to 32 GB | 4 to 32 GB | ~70-100% |
With the introduction of Java6 (in particular Websphere 7.x), 64-bit compressed technology has been introduced where 64 bit JVM's can use 32 bit heap offset to reference heap data. This offers larger memory space than 32 bit space and reduces memory footprint on 64 bit, increased throughput and more efficient heap utilization. Compression is disabled by default, but can be enabled using -Xcompressedrefs switch.
No comments:
Post a Comment