English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 April 2017, 10:29   #1
clebin
Registered User
 
clebin's Avatar
 
Join Date: Apr 2012
Location: Cardiff
Posts: 405
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?
clebin is offline  
Old 26 April 2017, 11:35   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
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
roondar is offline  
Old 26 April 2017, 14:55   #3
clebin
Registered User
 
clebin's Avatar
 
Join Date: Apr 2012
Location: Cardiff
Posts: 405
Quote:
Originally Posted by roondar View Post
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.
I want to find out how much memory my program is using, basically.

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:
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
Thanks! I'll check that out. It's only needed during development, so KS2.0+ is fine.
clebin is offline  
Old 30 November 2017, 08:05   #4
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
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
kamelito is offline  
Old 30 November 2017, 18:07   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,503
Quote:
Originally Posted by roondar View Post
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.
AvailMem() exists in 1.x.

UAE debugger "Tm" also shows some detailed memory list information.
Toni Wilen is offline  
Old 01 December 2017, 10:46   #6
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Oh, I didn't know AvailMem() was part of 1.x. Very useful to know!
roondar is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09171 seconds with 13 queries