This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237864

Summary: [heapwalker] heap model can use less memory
Product: profiler Reporter: Tomas Hurka <thurka>
Component: EngineAssignee: Tomas Hurka <thurka>
Status: RESOLVED FIXED    
Severity: normal Keywords: VISUALVM
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Tomas Hurka 2013-10-31 14:22:53 UTC
org.netbeans.lib.profiler.heap.StringSegment has a big HashMap<Long,Long>. In 700M heap dump, it has about 600000 entries and consumes over 50M of memory. The memory consumption of the StringSegment instance can be improved by replacing HashMap<Long,Long> with a special type of map. It uses long[] to store the key/values pairs (similar idea is used in IdentityHashMap, where key/value pairs are stored in Object[]). Such map consumes around 15M in the same heap dump.
Comment 1 Tomas Hurka 2013-10-31 15:49:55 UTC
Fixed in profiler-main

changeset:   266015:ca4b9d2ce94a
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Oct 31 16:30:02 2013 +0100
summary:     issue #237864, use LongHashMap instead of HashMap<Long,Long>