Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RamClass: Segment allocation enhancements #20831

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
343b33b
RamClass: Segment allocation enhancements
h3110n3rv3 Dec 10, 2024
0e80458
addressing PR comments
h3110n3rv3 Dec 19, 2024
ba12441
Merge branch 'eclipse-openj9:master' into ramClass-segment-allocation
h3110n3rv3 Jan 9, 2025
9af51ab
testing changes - 1
h3110n3rv3 Jan 9, 2025
452a247
Merge branch 'ramClass-segment-allocation' of https://github.com/h311…
h3110n3rv3 Jan 9, 2025
59f05c9
test 2
h3110n3rv3 Jan 9, 2025
19617c5
removing trailing spaces
h3110n3rv3 Jan 9, 2025
c9294f1
trim trailing whitespace
h3110n3rv3 Jan 9, 2025
4c5277d
RamClass: Segment allocation enhancements
h3110n3rv3 Dec 10, 2024
7cd5b28
addressing PR comments
h3110n3rv3 Dec 19, 2024
3dacc48
testing changes - 1
h3110n3rv3 Jan 9, 2025
54adb68
Correct handling of pull request builds for z/OS
keithc-ca Jan 6, 2025
1102e1b
Update test descriptions to include sanity.openjdk
hzongaro Sep 26, 2024
951aeb8
Add methods to check if array class can be trusted as fixed class
a7ehuo Dec 17, 2024
cd34c67
Avoid segfaults in j9vmem_testOverlappingSegments
cjjdespres May 17, 2024
b5a261f
JFR ThreadContextSwitchRate fix-ups
thallium Jan 3, 2025
f4e6ca7
Iprofiler records the class for direct calls
mpirvu Jan 3, 2025
aca74ec
createBalancedBST changed param from Compilation to TR_J9SharedCache
mpirvu Jan 3, 2025
8810b81
Refactor TR_AggregationHT in Iprofiler code
mpirvu Jan 4, 2025
b0ecdbe
Dump IProfiler info using the new infra
mpirvu Jan 4, 2025
cb64a54
Support for writing all IProfiler info to SCC
mpirvu Jan 4, 2025
7ee557c
Remove System.security field for JDK 24+
theresa-m Dec 17, 2024
4ee8bbe
Enable System.security reflection test for JDK24
theresa-m Dec 17, 2024
f6e1362
Remove uses of getSecurityManager from java.lang.System for JDK24+
theresa-m Dec 19, 2024
02ee4f3
Fix java.lang.System formatting
theresa-m Jan 7, 2025
892bdee
test 2
h3110n3rv3 Jan 9, 2025
e9c5f16
removing trailing spaces
h3110n3rv3 Jan 9, 2025
61bea9f
trim trailing whitespace
h3110n3rv3 Jan 9, 2025
b883ab7
Merge branch 'ramClass-segment-allocation' of https://github.com/h311…
h3110n3rv3 Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 101 additions & 49 deletions runtime/jcl/common/mgmtmemory.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static UDATA getIndexFromGCID(J9JavaLangManagementData *mgmt, UDATA id);
jobject JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getHeapMemoryUsageImpl(JNIEnv *env, jobject beanInstance, jclass memoryUsage, jobject memUsageConstructor)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
jlong used = 0;
jlong committed = 0;
jmethodID ctor = NULL;
Expand All @@ -51,7 +51,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getHeapMemoryUsageIm
jobject JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getNonHeapMemoryUsageImpl(JNIEnv *env, jobject beanInstance, jclass memoryUsage, jobject memUsageConstructor)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jlong used = 0;
jlong committed = 0;
Expand All @@ -76,25 +76,77 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getNonHeapMemoryUsag
omrthread_monitor_enter(javaVM->classTableMutex);
classLoader = javaVM->internalVMFunctions->allClassLoadersStartDo(&walkState, javaVM, 0);
while (NULL != classLoader) {
UDATA *udataFreeListBlock = classLoader->ramClassUDATABlockFreeList;
J9RAMClassFreeListBlock *tinyFreeListBlock = classLoader->ramClassTinyBlockFreeList;
J9RAMClassFreeListBlock *smallFreeListBlock = classLoader->ramClassSmallBlockFreeList;
J9RAMClassFreeListBlock *largeFreeListBlock = classLoader->ramClassLargeBlockFreeList;
while (NULL != udataFreeListBlock) {
used -= sizeof(UDATA);
udataFreeListBlock = *(UDATA **) udataFreeListBlock;
J9RAMClassUDATABlockFreeList *udataFreeListBlock = &classLoader->ramClassUDATABlocks;
h3110n3rv3 marked this conversation as resolved.
Show resolved Hide resolved
J9RAMClassFreeLists *sub4gFreeListBlock = &classLoader->sub4gBlock;
J9RAMClassFreeLists *freqFreeListBlock = &classLoader->frequentlyAccessedBlock;
J9RAMClassFreeLists *InFreqFreeListBlock = &classLoader->inFrequentlyAccessedBlock;
h3110n3rv3 marked this conversation as resolved.
Show resolved Hide resolved
if (NULL != udataFreeListBlock) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not necessary since classLoader->ramClassUDATABlocks is not a pointer. This applies to the J9RAMClassFreeLists's as well.

UDATA *sub4gListBlock = udataFreeListBlock->ramClassSub4gUDATABlockFreeList;
UDATA *freqListBlock = udataFreeListBlock->ramClassFreqUDATABlockFreeList;
UDATA *inFreqListBlock = udataFreeListBlock->ramClassInFreqUDATABlockFreeList;
while (NULL != sub4gListBlock) {
used -= sizeof(UDATA);
sub4gListBlock = *(UDATA **)sub4gListBlock;
}
while (NULL != freqListBlock) {
used -= sizeof(UDATA);
freqListBlock = *(UDATA **)freqListBlock;
}
while (NULL != inFreqListBlock) {
used -= sizeof(UDATA);
inFreqListBlock = *(UDATA **)inFreqListBlock;
}
}
while (NULL != tinyFreeListBlock) {
used -= tinyFreeListBlock->size;
tinyFreeListBlock = tinyFreeListBlock->nextFreeListBlock;
if (NULL != sub4gFreeListBlock) {
J9RAMClassFreeListBlock *tinyFreeListBlock = sub4gFreeListBlock->ramClassTinyBlockFreeList;
J9RAMClassFreeListBlock *smallFreeListBlock = sub4gFreeListBlock->ramClassSmallBlockFreeList;
J9RAMClassFreeListBlock *largeFreeListBlock = sub4gFreeListBlock->ramClassLargeBlockFreeList;
while (NULL != tinyFreeListBlock) {
used -= tinyFreeListBlock->size;
tinyFreeListBlock = tinyFreeListBlock->nextFreeListBlock;
}
while (NULL != smallFreeListBlock) {
used -= smallFreeListBlock->size;
smallFreeListBlock = smallFreeListBlock->nextFreeListBlock;
}
while (NULL != largeFreeListBlock) {
used -= largeFreeListBlock->size;
largeFreeListBlock = largeFreeListBlock->nextFreeListBlock;
}
}
while (NULL != smallFreeListBlock) {
used -= smallFreeListBlock->size;
smallFreeListBlock = smallFreeListBlock->nextFreeListBlock;
if (NULL != freqFreeListBlock) {
J9RAMClassFreeListBlock *tinyFreeListBlock = freqFreeListBlock->ramClassTinyBlockFreeList;
J9RAMClassFreeListBlock *smallFreeListBlock = freqFreeListBlock->ramClassSmallBlockFreeList;
J9RAMClassFreeListBlock *largeFreeListBlock = freqFreeListBlock->ramClassLargeBlockFreeList;
while (NULL != tinyFreeListBlock) {
used -= tinyFreeListBlock->size;
tinyFreeListBlock = tinyFreeListBlock->nextFreeListBlock;
}
while (NULL != smallFreeListBlock) {
used -= smallFreeListBlock->size;
smallFreeListBlock = smallFreeListBlock->nextFreeListBlock;
}
while (NULL != largeFreeListBlock) {
used -= largeFreeListBlock->size;
largeFreeListBlock = largeFreeListBlock->nextFreeListBlock;
}
}
while (NULL != largeFreeListBlock) {
used -= largeFreeListBlock->size;
largeFreeListBlock = largeFreeListBlock->nextFreeListBlock;
if (NULL != InFreqFreeListBlock) {
J9RAMClassFreeListBlock *tinyFreeListBlock = InFreqFreeListBlock->ramClassTinyBlockFreeList;
J9RAMClassFreeListBlock *smallFreeListBlock = InFreqFreeListBlock->ramClassSmallBlockFreeList;
J9RAMClassFreeListBlock *largeFreeListBlock = InFreqFreeListBlock->ramClassLargeBlockFreeList;
while (NULL != tinyFreeListBlock) {
used -= tinyFreeListBlock->size;
tinyFreeListBlock = tinyFreeListBlock->nextFreeListBlock;
}
while (NULL != smallFreeListBlock) {
used -= smallFreeListBlock->size;
smallFreeListBlock = smallFreeListBlock->nextFreeListBlock;
}
while (NULL != largeFreeListBlock) {
used -= largeFreeListBlock->size;
largeFreeListBlock = largeFreeListBlock->nextFreeListBlock;
}
}
classLoader = javaVM->internalVMFunctions->allClassLoadersNextDo(&walkState);
}
Expand Down Expand Up @@ -166,7 +218,7 @@ jint JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getObjectPendingFinalizationCountImpl(JNIEnv *env, jobject beanInstance)
{
#if defined(J9VM_GC_FINALIZATION)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
return (jint)javaVM->memoryManagerFunctions->j9gc_get_objects_pending_finalization_count(javaVM);
#else
return (jint)0;
Expand All @@ -176,15 +228,15 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getObjectPendingFina
jboolean JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_isVerboseImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

return VERBOSE_GC == (VERBOSE_GC & javaVM->verboseLevel) ;
}

void JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setVerboseImpl(JNIEnv *env, jobject beanInstance, jboolean flag)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9VerboseSettings verboseOptions;

memset(&verboseOptions, 0, sizeof(J9VerboseSettings));
Expand All @@ -197,7 +249,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setVerboseImpl(JNIEn
void JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryManagers(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
jclass memBean = NULL;
jstring childName = NULL;
jmethodID helperID = NULL;
Expand Down Expand Up @@ -234,7 +286,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryManagers
}

for (idx = 0; idx < mgmt->supportedCollectors; ++idx) {
id = (jint) mgmt->garbageCollectors[idx].id;
id = (jint)mgmt->garbageCollectors[idx].id;
childName = (*env)->NewStringUTF(env, mgmt->garbageCollectors[idx].name);
if (NULL == childName) {
return;
Expand All @@ -247,7 +299,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryManagers
void JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryPools(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
jclass memBean = NULL;
jstring childName = NULL;
jmethodID helperID = NULL;
Expand All @@ -267,7 +319,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryPools(JN

/* Heap Memory Pools */
for (idx = 0; idx < mgmt->supportedMemoryPools; ++idx) {
id = (jint) mgmt->memoryPools[idx].id;
id = (jint)mgmt->memoryPools[idx].id;
childName = (*env)->NewStringUTF(env, mgmt->memoryPools[idx].name);
if (NULL == childName) {
return;
Expand All @@ -281,7 +333,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryPools(JN

/* NonHeap Memory Pools */
for (idx = 0; idx < mgmt->supportedNonHeapMemoryPools; ++idx) {
id = (jint) mgmt->nonHeapMemoryPools[idx].id;
id = (jint)mgmt->nonHeapMemoryPools[idx].id;
childName = (*env)->NewStringUTF(env, mgmt->nonHeapMemoryPools[idx].name);
if (NULL == childName) {
return;
Expand All @@ -297,15 +349,15 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_createMemoryPools(JN
jlong JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMaxHeapSizeLimitImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

return javaVM->memoryManagerFunctions->j9gc_get_maximum_heap_size(javaVM);
}

jlong JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMaxHeapSizeImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
UDATA softmx = javaVM->memoryManagerFunctions->j9gc_get_softmx(javaVM);

/* if no softmx has been set, report -Xmx instead as it is the current max heap size */
Expand All @@ -318,15 +370,15 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMaxHeapSizeImpl(J
jlong JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMinHeapSizeImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

return javaVM->memoryManagerFunctions->j9gc_get_initial_heap_size(javaVM);
}

void JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setMaxHeapSizeImpl(JNIEnv *env, jobject beanInstance, jlong newsoftmx)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

javaVM->memoryManagerFunctions->j9gc_set_softmx(javaVM, (UDATA)newsoftmx);
}
Expand All @@ -337,7 +389,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setSharedClassCacheS
jboolean ret = JNI_FALSE;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
if (0 != javaVM->sharedClassConfig->setMinMaxBytes(javaVM, (U_32)value, -1, -1, -1, -1)) {
Expand All @@ -354,7 +406,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setSharedClassCacheM
jboolean ret = JNI_FALSE;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
if (0 != javaVM->sharedClassConfig->setMinMaxBytes(javaVM, (U_32)-1, (I_32)value, -1, -1, -1)) {
Expand All @@ -371,7 +423,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setSharedClassCacheM
jboolean ret = JNI_FALSE;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
if (0 != javaVM->sharedClassConfig->setMinMaxBytes(javaVM, (U_32)-1, -1, (I_32)value, -1, -1)) {
Expand All @@ -388,7 +440,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setSharedClassCacheM
jboolean ret = JNI_FALSE;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
if (0 != javaVM->sharedClassConfig->setMinMaxBytes(javaVM, (U_32)-1, -1, -1, (I_32)value, -1)) {
Expand All @@ -405,7 +457,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_setSharedClassCacheM
jboolean ret = JNI_FALSE;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
if (0 != javaVM->sharedClassConfig->setMinMaxBytes(javaVM, (U_32)-1, -1, -1, -1, (I_32)value)) {
Expand All @@ -422,7 +474,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getSharedClassCacheS
U_32 ret = 0;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
javaVM->sharedClassConfig->getUnstoredBytes(javaVM, &ret, NULL, NULL);
Expand All @@ -437,7 +489,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getSharedClassCacheM
U_32 ret = 0;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
javaVM->sharedClassConfig->getUnstoredBytes(javaVM, NULL, &ret, NULL);
Expand All @@ -452,7 +504,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getSharedClassCacheM
U_32 ret = 0;

#if defined(J9VM_OPT_SHARED_CLASSES)
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;

if (javaVM->sharedClassConfig) {
javaVM->sharedClassConfig->getUnstoredBytes(javaVM, NULL, NULL, &ret);
Expand All @@ -470,7 +522,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_isSetMaxHeapSizeSupp
jstring JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCModeImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
const char *gcMode = javaVM->memoryManagerFunctions->j9gc_get_gcmodestring(javaVM);

if (NULL != gcMode) {
Expand All @@ -483,7 +535,7 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCModeImpl(JNIEnv
jlong JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCMainThreadCpuUsedImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jlong result = 0;

Expand All @@ -497,12 +549,12 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCMainThreadCpuUs
jlong JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCWorkerThreadsCpuUsedImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jlong result = 0;

omrthread_rwmutex_enter_read(mgmt->managementDataLock);
result = (jlong) mgmt->gcWorkerCpuTime;
result = (jlong)mgmt->gcWorkerCpuTime;
omrthread_rwmutex_exit_read(mgmt->managementDataLock);

return result;
Expand All @@ -511,12 +563,12 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getGCWorkerThreadsCp
jint JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMaximumGCThreadsImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jint result = 0;

omrthread_rwmutex_enter_read(mgmt->managementDataLock);
result = (jint) mgmt->gcMaxThreads;
result = (jint)mgmt->gcMaxThreads;
omrthread_rwmutex_exit_read(mgmt->managementDataLock);

return result;
Expand All @@ -525,12 +577,12 @@ Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getMaximumGCThreadsI
jint JNICALL
Java_com_ibm_java_lang_management_internal_MemoryMXBeanImpl_getCurrentGCThreadsImpl(JNIEnv *env, jobject beanInstance)
{
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jint result = 0;

omrthread_rwmutex_enter_read(mgmt->managementDataLock);
result = (jint) mgmt->gcCurrentThreads;
result = (jint)mgmt->gcCurrentThreads;
omrthread_rwmutex_exit_read(mgmt->managementDataLock);

return result;
Expand All @@ -541,7 +593,7 @@ void JNICALL
Java_com_ibm_lang_management_internal_MemoryNotificationThread_processNotificationLoop(JNIEnv *env, jobject threadInstance)
{
/* currently, the only notification queue is for the heap */
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
jclass threadClass = NULL;
jclass stringClass = NULL;
Expand Down Expand Up @@ -726,7 +778,7 @@ Java_com_ibm_lang_management_internal_MemoryNotificationThread_processNotificati
} else {
/* dispatch usage threshold Notification */
memoryPoolUsageThreshold *usageThreshold = notification->usageThreshold;
idx = (U_32) getIndexFromMemoryPoolID(mgmt, usageThreshold->poolID);
idx = (U_32)getIndexFromMemoryPoolID(mgmt, usageThreshold->poolID);
pool = &mgmt->memoryPools[idx];
poolName = poolNames[idx];
if (THRESHOLD_EXCEEDED == notification->type) {
Expand Down Expand Up @@ -788,7 +840,7 @@ void JNICALL
Java_com_ibm_lang_management_internal_MemoryNotificationThreadShutdown_sendShutdownNotification(JNIEnv *env, jobject instance)
{
/* currently, the only queue is the heap usage notification queue */
J9JavaVM *javaVM = ((J9VMThread *) env)->javaVM;
J9JavaVM *javaVM = ((J9VMThread *)env)->javaVM;
J9JavaLangManagementData *mgmt = javaVM->managementData;
J9MemoryNotification *notification = NULL;
J9MemoryNotification *next = NULL;
Expand Down
Loading