@@ -461,6 +461,12 @@ struct ThreadDumpEntry {
461461 UDATA resultLength;
462462};
463463
464+ struct PhysicalMemoryEntry {
465+ I_64 ticks;
466+ U_64 totalSize;
467+ U_64 usedSize;
468+ };
469+
464470struct JFRConstantEvents {
465471 JVMInformationEntry JVMInfoEntry;
466472 CPUInformationEntry CPUInfoEntry;
@@ -555,6 +561,8 @@ class VM_JFRConstantPoolTypes {
555561 UDATA _dataLossCount;
556562 J9Pool *_threadDumpTable;
557563 UDATA _threadDumpCount;
564+ J9Pool *_physicalMemoryTable;
565+ UDATA _physicalMemoryCount;
558566
559567 /* Periodic events. */
560568 bool _shouldWriteJVMInformation;
@@ -565,7 +573,6 @@ class VM_JFRConstantPoolTypes {
565573 bool _shouldWriteInitialEnvironmentVariableEvents;
566574 bool _shouldWritewriteGCHeapConfigurationEvent;
567575 bool _shouldWriteYoungGenerationConfigurationEvent;
568- bool _shouldWritePhysicalMemory;
569576 bool _shouldWriteSystemProcess;
570577 bool _shouldWriteNativeLibrary;
571578 bool _shouldWriteModuleRequire;
@@ -875,6 +882,9 @@ class VM_JFRConstantPoolTypes {
875882 void addGCHeapSummaryEntry (J9JFRGCHeapSummary *gcHeapSummaryData);
876883
877884 void addNetworkUtilizationEntry (J9JFRNetworkUtilization *networkUtilizationData);
885+
886+ void addPhysicalMemoryEntry (J9JFRPhysicalMemory *physicalMemoryData);
887+
878888 void addDataLossEntry (J9JFRDataLoss *dataLossData);
879889
880890 void addThreadDumpEntry (J9JFRThreadDump *threadDumpData);
@@ -1256,6 +1266,16 @@ class VM_JFRConstantPoolTypes {
12561266 return _stackFrameCount;
12571267 }
12581268
1269+ UDATA getPhysicalMemoryCount ()
1270+ {
1271+ return _physicalMemoryCount;
1272+ }
1273+
1274+ J9Pool *getPhysicalMemoryTable ()
1275+ {
1276+ return _physicalMemoryTable;
1277+ }
1278+
12591279 bool shouldWriteJVMInformation ()
12601280 {
12611281 return _shouldWriteJVMInformation;
@@ -1296,11 +1316,6 @@ class VM_JFRConstantPoolTypes {
12961316 return _shouldWriteYoungGenerationConfigurationEvent;
12971317 }
12981318
1299- bool shouldWritePhysicalMemory ()
1300- {
1301- return _shouldWritePhysicalMemory;
1302- }
1303-
13041319 bool shouldWriteSystemProcess ()
13051320 {
13061321 return _shouldWriteSystemProcess;
@@ -1430,7 +1445,7 @@ class VM_JFRConstantPoolTypes {
14301445 _shouldWriteYoungGenerationConfigurationEvent = true ;
14311446 break ;
14321447 case J9JFR_EVENT_TYPE_PHYSICAL_MEMORY :
1433- _shouldWritePhysicalMemory = true ;
1448+ addPhysicalMemoryEntry ((J9JFRPhysicalMemory *)event) ;
14341449 break ;
14351450 case J9JFR_EVENT_TYPE_SYSTEM_PROCESS :
14361451 _shouldWriteSystemProcess = true ;
@@ -2170,6 +2185,8 @@ class VM_JFRConstantPoolTypes {
21702185 , _dataLossCount(0 )
21712186 , _threadDumpTable(NULL )
21722187 , _threadDumpCount(0 )
2188+ , _physicalMemoryTable(NULL )
2189+ , _physicalMemoryCount(0 )
21732190 , _shouldWriteJVMInformation(false )
21742191 , _shouldWriteCPUInformationEvent(false )
21752192 , _shouldWriteVirtualizationInformationEvent(false )
@@ -2178,7 +2195,6 @@ class VM_JFRConstantPoolTypes {
21782195 , _shouldWriteInitialEnvironmentVariableEvents(false )
21792196 , _shouldWritewriteGCHeapConfigurationEvent(false )
21802197 , _shouldWriteYoungGenerationConfigurationEvent(false )
2181- , _shouldWritePhysicalMemory(false )
21822198 , _shouldWriteSystemProcess(false )
21832199 , _shouldWriteNativeLibrary(false )
21842200 , _shouldWriteModuleRequire(false )
@@ -2338,6 +2354,13 @@ class VM_JFRConstantPoolTypes {
23382354 goto done;
23392355 }
23402356
2357+ _physicalMemoryTable = pool_new (sizeof (PhysicalMemoryEntry), 0 , sizeof (U_64 ), 0 , J9_GET_CALLSITE (), OMRMEM_CATEGORY_VM , POOL_FOR_PORT (privatePortLibrary));
2358+ if (NULL == _physicalMemoryTable) {
2359+ _buildResult = OutOfMemory;
2360+ goto done;
2361+ }
2362+
2363+
23412364 _systemProcessTable = pool_new (sizeof (SystemProcessEntry), 0 , sizeof (U_64 ), 0 , J9_GET_CALLSITE (), OMRMEM_CATEGORY_VM , POOL_FOR_PORT (privatePortLibrary));
23422365 if (NULL == _systemProcessTable) {
23432366 _buildResult = OutOfMemory;
@@ -2516,6 +2539,7 @@ class VM_JFRConstantPoolTypes {
25162539 pool_kill (_networkUtilizationTable);
25172540 pool_kill (_dataLossTable);
25182541 pool_kill (_threadDumpTable);
2542+ pool_kill (_physicalMemoryTable);
25192543 freeNetworkInterfaceNames ();
25202544 j9mem_free_memory (_globalStringTable);
25212545 }
0 commit comments