informa
/
2 MIN READ
News

Feature: 'Monitoring Your PC's Memory Usage'

In this in-depth Gamasutra feature, veteran developer Jelle van der Beek maps out the memory analysis tool he created while working at Playlogic, focusing speci
When developing video games, satisfying the platform's memory requirements is one of the most challenging tasks. In this in-depth feature, veteran developer Jelle van der Beek maps out the memory analysis tool created while working at Playlogic, focusing on monitoring memory use on the PC. In this excerpt, the developer discusses to concept behind the tool, called MemAnalyze 2.0, which builds upon the tool's previous version covered in earlier Gamasutra features (part one and two): “We begin by intercepting all memory allocations in the game. For each allocation that is performed, metadata is saved in memory, most notably callstack information. At any moment in time the user can select to write all allocation data to file. The file serves as input for our MemAnalyze tool. The tool can analyse the data and offer multiple views on that data. This concept has some drawbacks: - Monitoring memory usage is limited to a single moment in time, a snapshot of the memory statistics of the game. - Storing metadata in the application that is being monitored clutters your memory statistics. In my test environment, which is an average sized commercial game, the top of the allocation count is roughly half a million allocations. About 80.000 of those allocations were performed by operator new. The size of the metadata of an allocated block differs per block because of variable callstack lengths, but one of my tests shows that on average 126 bytes are needed per allocated block. Note that in this test 32 bit addresses were stored in the callstack. This means that approximately 77 megabytes of additional memory is needed for a memory map containing all metadata per block. If only the allocations from operator new were stored, we would need approximately 9.5 megabytes. To remove both restrictions, we now instead send any allocation data directly over the network. A tool that runs on a PC then gathers the allocation mutations and maintains an internal memory map. This tool can then do real-time analysis on its internal memory map. That’s actually all there is to it.” You can now read the complete feature, which includes an exhaustive analysis of the MemAnalyze tool, including code samples and a look ahead at what the future holds (no registration required, please feel free to link to this column from external websites).

Latest Jobs

Cryptic Studios

Remote
1.19.23
Senior Producer

Anne Arundel Community College

Arnold, MD, USA
1.30.23
Instructor/Assistant Professor, Game Art

Night School Studio

Los Angeles, CA, USA
1.09.23
Level Designer / Scripter, Games Studio
More Jobs   

CONNECT WITH US

Explore the
Subscribe to
Follow us

Game Developer Job Board

Game Developer Newsletter

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more