Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion debugtools/DDR_VM/data/superset-constants.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2411,13 +2411,13 @@ C|MEMORY_TYPE_CODE
C|MEMORY_TYPE_DEBUG_INFO
C|MEMORY_TYPE_DEFAULT
C|MEMORY_TYPE_DISCARDABLE
C|MEMORY_TYPE_DISCLAIMABLE_TO_FILE
C|MEMORY_TYPE_DYNAMIC_LOADED_CLASSES
C|MEMORY_TYPE_FIXED
C|MEMORY_TYPE_FIXEDSIZE
C|MEMORY_TYPE_FIXED_RAM
C|MEMORY_TYPE_FIXED_RAM_CLASS
C|MEMORY_TYPE_FROM_JXE
C|MEMORY_TYPE_IGC_SCAN_QUEUE
C|MEMORY_TYPE_IMMORTAL
C|MEMORY_TYPE_JIT_PERSISTENT
C|MEMORY_TYPE_JIT_SCRATCH_SPACE
Expand All @@ -2429,6 +2429,9 @@ C|MEMORY_TYPE_OLD_RAM
C|MEMORY_TYPE_OLD_ROM
C|MEMORY_TYPE_RAM
C|MEMORY_TYPE_RAM_CLASS
C|MEMORY_TYPE_RAM_CLASS_SUB4G
C|MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED
C|MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED
C|MEMORY_TYPE_ROM
C|MEMORY_TYPE_ROM_CLASS
C|MEMORY_TYPE_SCOPED
Expand Down
37 changes: 28 additions & 9 deletions runtime/rasdump/javadump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private :
void writeGPCategory (void *gpInfo, const char* prefix, U_32 category);
void writeGPValue (const char* prefix, const char* name, U_32 kind, void* value);
void writeJitMethod (J9VMThread* vmThread);
void writeSegments (J9MemorySegmentList* list, BOOLEAN isCodeCacheSegment);
void writeSegments (J9MemorySegmentList* list, BOOLEAN isCodeCacheSegment, UDATA segmentSubType);
void writeTraceHistory (U_32 type);
void writeGCHistoryLines (UtThreadData** thr, UtTracePointIterator* iterator, const char* typePrefix);
void writeDeadLocks (void);
Expand Down Expand Up @@ -1610,15 +1610,29 @@ JavaCoreDumpWriter::writeMemorySection(void)
"1STSEGTYPE Internal Memory\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->memorySegments, false);
writeSegments(_VirtualMachine->memorySegments, false, 0);

/* Write the class memory segments sub-section */
_OutputStream.writeCharacters(
"NULL\n"
"1STSEGTYPE Class Memory\n"
"1STSEGTYPE Class Memory Sub-4G\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->classMemorySegments, false);
writeSegments(_VirtualMachine->classMemorySegments, false, MEMORY_TYPE_RAM_CLASS_SUB4G);

_OutputStream.writeCharacters(
"NULL\n"
"1STSEGTYPE Class Memory Above-4G Frequently Accessed\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->classMemorySegments, false, MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED);

_OutputStream.writeCharacters(
"NULL\n"
"1STSEGTYPE Class Memory Above-4G Infrequently Accessed\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->classMemorySegments, false, MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED);

/* Write the jit memory segments sub-section */
#if defined(J9VM_INTERP_NATIVE_SUPPORT)
Expand All @@ -1628,7 +1642,7 @@ JavaCoreDumpWriter::writeMemorySection(void)
"1STSEGTYPE JIT Code Cache\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->jitConfig->codeCacheList, true);
writeSegments(_VirtualMachine->jitConfig->codeCacheList, true, 0);

/* Write the limit specified for the code cache size as well. */
int decimalLength = (sizeof(void *) == 4) ? 10 : 20;
Expand All @@ -1643,7 +1657,7 @@ JavaCoreDumpWriter::writeMemorySection(void)
"1STSEGTYPE JIT Data Cache\n"
SEGMENT_HEADER
);
writeSegments(_VirtualMachine->jitConfig->dataCacheList, false);
writeSegments(_VirtualMachine->jitConfig->dataCacheList, false, 0);
/* Write the limit specified for the data cache size as well. */
_OutputStream.writeCharacters("1STSEGLIMIT ");
_OutputStream.writeCharacters("Allocation limit: ");
Expand Down Expand Up @@ -3926,7 +3940,7 @@ JavaCoreDumpWriter::writeJitMethod(J9VMThread* vmThread)
/* */
/**************************************************************************************************/
void
JavaCoreDumpWriter::writeSegments(J9MemorySegmentList* list, BOOLEAN isCodeCacheSegment)
JavaCoreDumpWriter::writeSegments(J9MemorySegmentList* list, BOOLEAN isCodeCacheSegment, UDATA segmentSubType)
{
/* Loop through the segments writing their data */
J9MemorySegment* segment = list ? list->nextSegment : NULL;
Expand All @@ -3938,8 +3952,13 @@ JavaCoreDumpWriter::writeSegments(J9MemorySegmentList* list, BOOLEAN isCodeCache
UDATA warmAlloc = 0;
UDATA coldAlloc = 0;

if (MEMORY_TYPE_SHARED_META == segment->type) {
/* Discard the class cache metadata segment (it overlaps the last shared ROM class segment in the cache) */
if ((MEMORY_TYPE_SHARED_META == segment->type)
|| ((0 != segmentSubType) && J9_ARE_NO_BITS_SET(segment->type, segmentSubType))
) {
/* Skip:
* - The class cache metadata segment (it overlaps the last shared ROM class segment in the cache).
* - Any segment when a subType mask is provided and segment->type has no bits in common with that mask.
*/
segment = segment->nextSegment;
continue;
}
Expand Down
4 changes: 4 additions & 0 deletions runtime/vm/createramclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4368,6 +4368,10 @@ allocateRemainingFragments(RAMClassAllocationRequest *requests, UDATA allocation
UDATA memoryType = MEMORY_TYPE_RAM_CLASS;
if (SK_SUB4G == segmentKind) {
memoryType |= MEMORY_TYPE_RAM_CLASS_SUB4G;
} else if (SK_ABOVE4G_FREQUENTLY_ACCESSED == segmentKind) {
memoryType |= MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED;
} else if (SK_ABOVE4G_INFREQUENTLY_ACCESSED == segmentKind) {
memoryType |= MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED;
}
Trc_VM_internalAllocateRAMClass_AllocateClassMemorySegment(fragmentsLeftToAllocate, newSegmentSize, classAllocationIncrement);
newSegment = allocateClassMemorySegment(javaVM, newSegmentSize, memoryType, classLoader, classAllocationIncrement);
Expand Down
5 changes: 3 additions & 2 deletions runtime/vm/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ U_32 memorySegmentListSize (J9MemorySegmentList *segmentList)
* 2. Everything else. Regardless of the type, it will be allocated
*/
static void *
allocateMemoryForSegment(J9JavaVM *javaVM,J9MemorySegment *segment, J9PortVmemParams *vmemParams, U_32 memoryCategory)
allocateMemoryForSegment(J9JavaVM *javaVM, J9MemorySegment *segment, J9PortVmemParams *vmemParams, U_32 memoryCategory)
{
void *tmpAddr = NULL;
PORT_ACCESS_FROM_GINFO(javaVM);
Expand Down Expand Up @@ -864,7 +864,8 @@ printSegments(J9MemorySegment *s, void* data)
if ((type & MEMORY_TYPE_FIXED_RAM_CLASS) == MEMORY_TYPE_FIXED_RAM_CLASS) printf("MEMORY_TYPE_FIXED_RAM_CLASS ");
if ((type & MEMORY_TYPE_RAM_CLASS) == MEMORY_TYPE_RAM_CLASS) printf("MEMORY_TYPE_RAM_CLASS ");
if ((type & MEMORY_TYPE_RAM_CLASS_SUB4G) == MEMORY_TYPE_RAM_CLASS_SUB4G) printf("MEMORY_TYPE_RAM_CLASS_SUB4G ");
if ((type & MEMORY_TYPE_IGC_SCAN_QUEUE) == MEMORY_TYPE_IGC_SCAN_QUEUE) printf("MEMORY_TYPE_IGC_SCAN_QUEUE ");
if ((type & MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED) == MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED) printf("MEMORY_TYPE_RAM_CLASS_ABOVE4G_FREQUENTLY_ACCESSED ");
if ((type & MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED) == MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED) printf("MEMORY_TYPE_RAM_CLASS_ABOVE4G_INFREQUENTLY_ACCESSED ");
if ((type & MEMORY_TYPE_RAM) == MEMORY_TYPE_RAM) printf("MEMORY_TYPE_RAM ");
if ((type & MEMORY_TYPE_FIXED) == MEMORY_TYPE_FIXED) printf("MEMORY_TYPE_FIXED ");
if ((type & MEMORY_TYPE_JIT_SCRATCH_SPACE) == MEMORY_TYPE_JIT_SCRATCH_SPACE) printf("MEMORY_TYPE_JIT_SCRATCH_SPACE ");
Expand Down