26 April 2017, 10:29 | #1 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Tracking a game/program's memory usage
What's the best way to track the memory usage of my game?
I want to know how much spare memory I have to play with and I can't see the Workbench titlebar while it runs. * Some debug status built into the game? (nb. written in C, not ASM) * Some utility on Aminet that can log memory over time? * FS-UAE/WinUAE debug? (FS-UAE preferred) * HRTMon/Action Replay? How do others do this? |
26 April 2017, 11:35 | #2 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,438
|
I'm not sure whether you just want to know how much memory is free on the machine, or how much memory your program is using.
So, assuming you want to know how much free memory is available: There are indeed Aminet utilities, some with source, that can tell you how much free memory there is. You could also get the pointer to the Exec memory list and traverse it yourself, though that might involve some pointer arithmetic to work. As a last resort, you could also just execute the avail command and parse it's output. But these are only really needed if you're using Kickstart 1.3. If your game is running Kickstart 2.0+, the easiest way by far it to just use the Exec AvailMem() function. See: http://amigadev.elowar.com/read/ADCD.../node01EE.html |
26 April 2017, 14:55 | #3 | ||
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Quote:
It currently runs on a stock 512k machine and I want to know how much RAM is left for sound effects, etc. Knowing how much is free before and during is ok as I can do the maths with that. Quote:
|
||
30 November 2017, 08:05 | #4 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,866
|
Assuming your game load all the assets when running.
Try avail mem before launching the program and avail when the program is loaded. Do a substraction. Last edited by DH; 02 December 2017 at 00:49. Reason: Removed direct signature |
30 November 2017, 18:07 | #5 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
|
Quote:
UAE debugger "Tm" also shows some detailed memory list information. |
|
01 December 2017, 10:46 | #6 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,438
|
Oh, I didn't know AvailMem() was part of 1.x. Very useful to know!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to load program into fixed memory area | ShK | Coders. System | 3 | 07 July 2016 09:46 |
Tracking/music production on Amiga | jmph | New to Emulation or Amiga scene | 9 | 13 August 2015 18:33 |
Memory usage: Pinball dreams? | emuola | project.WHDLoad | 2 | 02 November 2014 13:43 |
Best program to test memory? | Mustangjeff | support.Hardware | 5 | 05 October 2012 07:43 |
tracking / MIDI - amiga vs pc | cosmiq | request.Apps | 3 | 05 April 2002 10:34 |
|
|