Skip to content

Commit

Permalink
Merge pull request #7462 from LinHu2016/off-heap-secondpart
Browse files Browse the repository at this point in the history
Off-Heap related update
  • Loading branch information
babsingh authored Sep 17, 2024
2 parents 57e2239 + fef811b commit 2ed8ffb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gc/base/SparseAddressOrderedFixedSizeDataPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ MM_SparseAddressOrderedFixedSizeDataPool::findFreeListEntry(uintptr_t size)
Assert_MM_true(NULL != returnAddr);
_approximateFreeMemorySize -= size;
_freeListPoolAllocBytes += size;
_allocObjectCount += 1;

Trc_MM_SparseAddressOrderedFixedSizeDataPool_freeListEntryFoundForData_success(returnAddr, (void *)size, _freeListPoolFreeNodesCount, (void *)_approximateFreeMemorySize, (void *)_freeListPoolAllocBytes);
}
Expand Down Expand Up @@ -356,6 +357,7 @@ MM_SparseAddressOrderedFixedSizeDataPool::returnFreeListEntry(void *dataAddr, ui

_approximateFreeMemorySize += size;
_freeListPoolAllocBytes -= size;
_allocObjectCount -= 1;
_lastFreeBytes = size;

Trc_MM_SparseAddressOrderedFixedSizeDataPool_returnFreeListEntry_success(dataAddr, (void *)size, _freeListPoolFreeNodesCount, (void *)_approximateFreeMemorySize, (void *)_freeListPoolAllocBytes);
Expand Down
10 changes: 10 additions & 0 deletions gc/base/SparseAddressOrderedFixedSizeDataPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class MM_SparseAddressOrderedFixedSizeDataPool : public MM_BaseVirtual
uintptr_t _lastFreeBytes; /**< Number of bytes free at end of last GC */
uintptr_t _freeListPoolFreeNodesCount; /**< Number of free list nodes. There's always at least one node in list therefore >= 1 */
uintptr_t _freeListPoolAllocBytes; /**< Byte amount allocated from sparse heap */
uintptr_t _allocObjectCount; /**< Object count allocated from sparse heap */

MM_GCExtensionsBase *_extensions; /**< GC Extensions for this JVM */
J9Pool *_freeListPool; /**< Memory pool to be used to create MM_SparseHeapLinkedFreeHeader nodes */
Expand Down Expand Up @@ -194,6 +195,14 @@ class MM_SparseAddressOrderedFixedSizeDataPool : public MM_BaseVirtual
return _freeListPoolAllocBytes;
}

/**
* Get the total count of the allocated objects
*/
MMINLINE uintptr_t getAllocObjectCount()
{
return _allocObjectCount;
}

/**
* Update the proxyObjPtr after an object has moved for the sparse data entry associated with the given dataPtr.
*
Expand All @@ -216,6 +225,7 @@ class MM_SparseAddressOrderedFixedSizeDataPool : public MM_BaseVirtual
, _lastFreeBytes(0)
, _freeListPoolFreeNodesCount(0)
, _freeListPoolAllocBytes(0)
, _allocObjectCount(0)
, _extensions(env->getExtensions())
, _freeListPool(NULL)
, _heapFreeList(NULL)
Expand Down
2 changes: 1 addition & 1 deletion gc/include/RootScannerTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef enum RootScannerEntity {
RootScannerEntity_MonitorLookupCachesComplete,
RootScannerEntity_MonitorReferenceObjectsComplete,
RootScannerEntity_DoubleMappedObjects, /* Obsolete */
RootScannerEntity_DoubleMappedOrVirtualLargeObjectHeapObjects,
RootScannerEntity_virtualLargeObjectHeapObjects,

/* Must be last, do not use this entity! */
RootScannerEntity_Count
Expand Down
15 changes: 15 additions & 0 deletions gc/verbose/schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element name="arraylet-unknown" type="vgc:arraylet-unknown" />
<element name="cpu-util" type="vgc:cpu-util" />
<element name="numa" type="vgc:numa" />
<element name="offheap-objects" type="vgc:offheap-objects" />
<element name="vmarg" type="vgc:vmarg" />
<element name="vmargs" type="vgc:vmargs" />
<element name="attribute" type="vgc:attribute" />
Expand Down Expand Up @@ -72,6 +73,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element name="finalization" type="vgc:finalization" />
<element name="ownableSynchronizers" type="vgc:ownableSynchronizers" />
<element name="continuations" type="vgc:continuations" />
<element name="offheap" type="vgc:offheap" />
<element name="stringconstants" type="vgc:stringconstants" />
<element name="object-monitors" type="vgc:object-monitors" />
<element name="classunload-info" type="vgc:classunload-info" />
Expand Down Expand Up @@ -176,6 +178,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element ref="vgc:arraylet-primitive" maxOccurs="1" minOccurs="0" />
<element ref="vgc:arraylet-unknown" maxOccurs="1" minOccurs="0" />
<element ref="vgc:numa" maxOccurs="1" minOccurs="0" />
<element ref="vgc:offheap-objects" maxOccurs="1" minOccurs="0" />
<element ref="vgc:pending-finalizers" maxOccurs="1" minOccurs="0" />
<element ref="vgc:continuation-objects" maxOccurs="1" minOccurs="0" />
<element ref="vgc:remembered-set" maxOccurs="1" minOccurs="0" />
Expand Down Expand Up @@ -494,6 +497,11 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<attribute name="cleared" type="integer" use="required" />
</complexType>

<complexType name="offheap">
<attribute name="candidates" type="integer" use="required" />
<attribute name="cleared" type="integer" use="required" />
</complexType>

<complexType name="stringconstants">
<attribute name="candidates" type="integer" use="required" />
<attribute name="cleared" type="integer" use="required" />
Expand Down Expand Up @@ -810,6 +818,11 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<attribute name="non-local-percent" type="integer" use="required" />
</complexType>

<complexType name="offheap-objects">
<attribute name="objects" type="integer" use="required" />
<attribute name="bytes" type="integer" use="required" />
</complexType>

<group name="gc-op-mark">
<sequence>
<element ref="vgc:trace-info" maxOccurs="1" minOccurs="1" />
Expand All @@ -818,6 +831,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element ref="vgc:finalization" maxOccurs="1" minOccurs="0" />
<element ref="vgc:ownableSynchronizers" maxOccurs="1" minOccurs="0" />
<element ref="vgc:continuations" maxOccurs="1" minOccurs="0" />
<element ref="vgc:offheap" maxOccurs="1" minOccurs="0" />
<element ref="vgc:references" maxOccurs="unbounded" minOccurs="0" />
<element ref="vgc:stringconstants" maxOccurs="1" minOccurs="0" />
<element ref="vgc:object-monitors" maxOccurs="1" minOccurs="0" />
Expand Down Expand Up @@ -881,6 +895,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element ref="vgc:finalization" maxOccurs="1" minOccurs="0" />
<element ref="vgc:ownableSynchronizers" maxOccurs="1" minOccurs="0" />
<element ref="vgc:continuations" maxOccurs="1" minOccurs="0" />
<element ref="vgc:offheap" maxOccurs="1" minOccurs="0" />
<element ref="vgc:references" maxOccurs="unbounded" minOccurs="0" />
<element ref="vgc:stringconstants" maxOccurs="1" minOccurs="0" />
<element ref="vgc:object-monitors" maxOccurs="1" minOccurs="0" />
Expand Down

0 comments on commit 2ed8ffb

Please sign in to comment.