Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8295475

Move non-resource allocation strategies out of ResourceObj

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b24

      HotSpot has a few allocation classes that other classes can inherit from to get different dynamic-allocation strategies:

      MetaspaceObj - allocates in the Metaspace
      CHeap - uses malloc
      ResourceObj - ...

      The last class sounds like it provide an allocation strategy to allocate inside a thread's resource area. This is true, but it also provides functions to allow the instances to be allocated in Areanas or even CHeap allocated memory.

      This is IMHO misleading, and often leads to confusion among HotSpot developers.

      I propose that we simplify ResourceObj to only provide an allocation strategy for resource allocations, and move the multi-allocation strategy feature to another class, which isn't named ResourceObj.

      In my proposal and prototype I've used the name AnyObj, as short, simple name. I'm open to changing the name to something else.

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: