MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Execute

Method Execute

ogsr_engine/xrGame/console_commands.cpp:137–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135public:
136 CCC_MemStats(LPCSTR N) : IConsole_Command(N) { bEmptyArgsHandled = TRUE; };
137 virtual void Execute(LPCSTR args)
138 {
139 //Memory.mem_compact();
140
141 u32 m_base = 0, c_base = 0, m_lmaps = 0, c_lmaps = 0;
142
143 // Resource check moved to m_pRender
144 if (Device.m_pRender)
145 Device.m_pRender->ResourcesGetMemoryUsage(m_base, c_base, m_lmaps, c_lmaps);
146
147 Log("--------------------------------------------------------------------------------");
148
149 SProcessMemInfo memCounters;
150 GetProcessMemInfo(memCounters);
151 Msg("[%I64dMB] physical memory installed, [%I64dMB] available, [%ld] percent of memory in use",
152 memCounters.TotalPhysicalMemory / (1024 * 1024),
153 memCounters.FreePhysicalMemory / (1024 * 1024),
154 memCounters.MemoryLoad);
155
156 Msg("PageFile total: [%I64dMB], free~ [%I64dMB]",
157 memCounters.TotalPageFile / (1024 * 1024), memCounters.FreePageFile / (1024 * 1024));
158
159 //PeakWorkingSetSize
160 //
161 //The peak working set size, in bytes.
162 //
163 //WorkingSetSize
164 //
165 //The current working set size, in bytes.
166
167 Msg("Engine memory usage (Working Set): [%I64dMB], peak: [%I64dMB]",
168 memCounters.WorkingSetSize / (1024 * 1024), memCounters.PeakWorkingSetSize / (1024 * 1024));
169
170 //PagefileUsage
171 //
172 //The Commit Charge value in bytes for this process. Commit Charge is the total amount of memory that the memory manager has committed for a running process.
173 //
174 //PeakPagefileUsage
175 //
176 //The peak value in bytes of the Commit Charge during the lifetime of this process.
177
178 Msg("Engine memory usage (Commit Charge): [%I64dMB], peak: [%I64dMB]",
179 memCounters.PagefileUsage / (1024 * 1024), memCounters.PeakPagefileUsage / (1024 * 1024));
180
181 Log("--------------------------------------------------------------------------------");
182
183 const size_t _process_heap = mem_usage_impl(nullptr, nullptr);
184 const u32 _render = ::Render->memory_usage();
185 const u32 _eco_strings = g_pStringContainer->stat_economy();
186 const u32 _eco_smem = g_pSharedMemoryContainer->stat_economy();
187
188 Msg("* [ D3D ]: textures count [%d]", (c_base + c_lmaps));
189 Msg("* [ D3D ]: textures[%d K]", (m_base + m_lmaps) / 1024);
190 Msg("* [x-ray]: process heap[%d K], render[%d K]", _process_heap / 1024, _render / 1024);
191 Msg("* [x-ray]: economy: strings[%d K], smem[%d K]", _eco_strings / 1024, _eco_smem);
192
193#ifdef DEBUG
194 Msg("* [x-ray]: file mapping: memory[%d K], count[%d]", g_file_mapped_memory / 1024, g_file_mapped_count);

Callers

nothing calls this directly

Calls 8

LogFunction · 0.85
GetProcessMemInfoFunction · 0.85
MsgFunction · 0.85
mem_usage_implFunction · 0.85
dump_file_mappingsFunction · 0.85
memory_usageMethod · 0.80
stat_economyMethod · 0.45

Tested by

no test coverage detected