@@ -467,6 +467,12 @@ struct ThreadDumpEntry {
467467 UDATA resultLength;
468468};
469469
470+ struct PhysicalMemoryEntry {
471+ I_64 ticks;
472+ U_64 totalSize;
473+ U_64 usedSize;
474+ };
475+
470476struct JFRConstantEvents {
471477 JVMInformationEntry JVMInfoEntry;
472478 CPUInformationEntry CPUInfoEntry;
@@ -563,6 +569,8 @@ class VM_JFRConstantPoolTypes {
563569 UDATA _threadDumpCount;
564570 J9Pool *_threadAllocationStatisticsTable;
565571 UDATA _threadAllocationStatisticsCount;
572+ J9Pool *_physicalMemoryTable;
573+ UDATA _physicalMemoryCount;
566574
567575 /* Periodic events. */
568576 bool _shouldWriteJVMInformation;
@@ -573,7 +581,6 @@ class VM_JFRConstantPoolTypes {
573581 bool _shouldWriteInitialEnvironmentVariableEvents;
574582 bool _shouldWritewriteGCHeapConfigurationEvent;
575583 bool _shouldWriteYoungGenerationConfigurationEvent;
576- bool _shouldWritePhysicalMemory;
577584 bool _shouldWriteSystemProcess;
578585 bool _shouldWriteNativeLibrary;
579586 bool _shouldWriteModuleRequire;
@@ -881,6 +888,9 @@ class VM_JFRConstantPoolTypes {
881888 void addGCHeapSummaryEntry (J9JFRGCHeapSummary *gcHeapSummaryData);
882889
883890 void addNetworkUtilizationEntry (J9JFRNetworkUtilization *networkUtilizationData);
891+
892+ void addPhysicalMemoryEntry (J9JFRPhysicalMemory *physicalMemoryData);
893+
884894 void addDataLossEntry (J9JFRDataLoss *dataLossData);
885895
886896 void addThreadDumpEntry (J9JFRThreadDump *threadDumpData);
@@ -1274,6 +1284,16 @@ class VM_JFRConstantPoolTypes {
12741284 return _stackFrameCount;
12751285 }
12761286
1287+ UDATA getPhysicalMemoryCount ()
1288+ {
1289+ return _physicalMemoryCount;
1290+ }
1291+
1292+ J9Pool *getPhysicalMemoryTable ()
1293+ {
1294+ return _physicalMemoryTable;
1295+ }
1296+
12771297 bool shouldWriteJVMInformation ()
12781298 {
12791299 return _shouldWriteJVMInformation;
@@ -1314,11 +1334,6 @@ class VM_JFRConstantPoolTypes {
13141334 return _shouldWriteYoungGenerationConfigurationEvent;
13151335 }
13161336
1317- bool shouldWritePhysicalMemory ()
1318- {
1319- return _shouldWritePhysicalMemory;
1320- }
1321-
13221337 bool shouldWriteSystemProcess ()
13231338 {
13241339 return _shouldWriteSystemProcess;
@@ -1448,7 +1463,7 @@ class VM_JFRConstantPoolTypes {
14481463 _shouldWriteYoungGenerationConfigurationEvent = true ;
14491464 break ;
14501465 case J9JFR_EVENT_TYPE_PHYSICAL_MEMORY :
1451- _shouldWritePhysicalMemory = true ;
1466+ addPhysicalMemoryEntry ((J9JFRPhysicalMemory *)event) ;
14521467 break ;
14531468 case J9JFR_EVENT_TYPE_SYSTEM_PROCESS :
14541469 _shouldWriteSystemProcess = true ;
@@ -2232,6 +2247,8 @@ class VM_JFRConstantPoolTypes {
22322247 , _threadDumpCount(0 )
22332248 , _threadAllocationStatisticsTable(NULL )
22342249 , _threadAllocationStatisticsCount(0 )
2250+ , _physicalMemoryTable(NULL )
2251+ , _physicalMemoryCount(0 )
22352252 , _shouldWriteJVMInformation(false )
22362253 , _shouldWriteCPUInformationEvent(false )
22372254 , _shouldWriteVirtualizationInformationEvent(false )
@@ -2240,7 +2257,6 @@ class VM_JFRConstantPoolTypes {
22402257 , _shouldWriteInitialEnvironmentVariableEvents(false )
22412258 , _shouldWritewriteGCHeapConfigurationEvent(false )
22422259 , _shouldWriteYoungGenerationConfigurationEvent(false )
2243- , _shouldWritePhysicalMemory(false )
22442260 , _shouldWriteSystemProcess(false )
22452261 , _shouldWriteNativeLibrary(false )
22462262 , _shouldWriteModuleRequire(false )
@@ -2406,6 +2422,13 @@ class VM_JFRConstantPoolTypes {
24062422 goto done;
24072423 }
24082424
2425+ _physicalMemoryTable = pool_new (sizeof (PhysicalMemoryEntry), 0 , sizeof (U_64 ), 0 , J9_GET_CALLSITE (), OMRMEM_CATEGORY_VM , POOL_FOR_PORT (privatePortLibrary));
2426+ if (NULL == _physicalMemoryTable) {
2427+ _buildResult = OutOfMemory;
2428+ goto done;
2429+ }
2430+
2431+
24092432 _systemProcessTable = pool_new (sizeof (SystemProcessEntry), 0 , sizeof (U_64 ), 0 , J9_GET_CALLSITE (), OMRMEM_CATEGORY_VM , POOL_FOR_PORT (privatePortLibrary));
24102433 if (NULL == _systemProcessTable) {
24112434 _buildResult = OutOfMemory;
@@ -2585,6 +2608,7 @@ class VM_JFRConstantPoolTypes {
25852608 pool_kill (_dataLossTable);
25862609 pool_kill (_threadDumpTable);
25872610 pool_kill (_threadAllocationStatisticsTable);
2611+ pool_kill (_physicalMemoryTable);
25882612 freeNetworkInterfaceNames ();
25892613 j9mem_free_memory (_globalStringTable);
25902614 }
0 commit comments