Hello,
We built a profiler and our profiler reports a problematic object (array intAddressableElements) in AbstractStructuredArrayBase.java file. The life cycles of different instances do not overlap, which means using a singleton pattern of this object (i.e., allocating a single object instance and reusing it without creating more instances) is safe and avoids memory bloat. To apply the singleton pattern, we can hoist intAddressableElements allocation out of allocateInternalStorage method, which is thread-safe.
Hello,
We built a profiler and our profiler reports a problematic object (array intAddressableElements) in AbstractStructuredArrayBase.java file. The life cycles of different instances do not overlap, which means using a singleton pattern of this object (i.e., allocating a single object instance and reusing it without creating more instances) is safe and avoids memory bloat. To apply the singleton pattern, we can hoist intAddressableElements allocation out of allocateInternalStorage method, which is thread-safe.