MM Memory drill down

#MM-Memory-drill-down

Heap bin pie chart ~13 GB actual size (JVM accounted ~7 GB)

#Heap-bin-pie-chart-~13-GB-actual-size-(JVM-accounted-~7-GB)

Unreachable objects 3.6 GB

#Unreachable-objects-3.6-GB

#

Reachable (7GB) vs Unreachable (3.6GB)

#Reachable-(7GB)-vs-Unreachable-(3.6GB)
Loading output library...

Lets Introspect the reachable memory

#Lets-Introspect-the-reachable-memory
Loading output library...

Culprits

#Culprits
  • Strings
  • Vectors
  • Concurrent hashmaps

Hypothesis for bringing the memory footprint down

#Hypothesis-for-bringing-the-memory-footprint-down

Vectors as an example for container data type using MemoryTestBench

#Vectors-as-an-example-for-container-data-type-using-MemoryTestBench

Lets see how resized Vectors perform

#Lets-see-how-resized-Vectors-perform

A Similar technique can be used to Concurrent Hashmaps Click Here to know how

#A-Similar-technique-can-be-used-to-Concurrent-Hashmaps-

Note : Strings can be enumerated or better yet, design the objects to use references

#Note-:-Strings-can-be-enumerated-or-better-yet,-design-the-objects-to-use-references

Files

#Files

ItemLocation

#ItemLocation

Folders

#Folders

EmailMessage

#EmailMessage

Users

#Users

Before optimization 13 GB

#Before-optimization-13-GB
Loading output library...

After Optimization Approximate 10.84GB

#After-Optimization-Approximate-10.84GB
Loading output library...
Loading output library...
Loading output library...
Loading output library...

Possible Solutions

#Possible-Solutions

#
  • Fine tuning the Java Garbage collector Click here
  • Conservatively use the available memory using the techniques stated above
  • When in doubt, always use StringBuilder instead of String in code

Thanks for your time

#Thanks-for-your-time

Sachin

#Sachin