@Juggernaut
Quote: "This is as far as I could get with your hint - ... But the result does not exactly tally with the task manager readings. Maybe I am missing something here ....."
Memory usage will be volatile. It can change at any time. The commands are guides and not absolutes but can give you a pretty good idea of memory usage.
Also, the memory use can be different if you run in full screen exclusive mode where most of your system resources will be used for your game. In windowed mode, you'll be sharing a lot more stuff with Windows OS so the values may not match up as you expect.
Here's the commands usage example:
sync on
autocam off
startvideomem = SYSTEM DMEM AVAILABLE() : `will return the total video memory available
startsystemmem = SYSTEM SMEM AVAILABLE() : `will return the total system memory available
rem create an object
make object sphere 1,25
move camera -40
do
text 0,0,"Original video mem = "+str$(startvideomem)
text 0,20,"Original system mem = "+str$(startsystemmem)
text 0,60,"Video mem remaining = "+str$(system dmem available())
text 0,80,"Video mem used = "+str$(startvideomem-SYSTEM DMEM AVAILABLE())
text 0,100,"System mem remaining = "+str$(system smem available())
text 0,120,"System mem used = "+str$(startsystemmem-system smem available())
sync
loop
Also if you have over 2 gigs of ram, the value might show as negative because of the size of a 32 bit integer. You may be able to cast the variable as a double.
Enjoy your day.