Memory Use

BlitzPlus Forums/BlitzPlus Beginners Area/Memory Use

Yue(Posted 2012) [#1]
How do I know how many megabytes you use my program and TotalVidMem TotalVidMem () simply returns the total memory on a graphics card, in bytes. Note that to retrieve the current number of bytes available, you must use AvailVidMem () and AvailVidMem (), AS THESE return me bytes.

Last edited 2012


Addi(Posted 2012) [#2]
Before loading anything
use AvailVidMem() to get the free space before having loaded anything.
Do this after having loaded your things again and then
substract the first result with the second and divide the result by(1024*1024)

Last edited 2012


Yue(Posted 2012) [#3]
??
(TotalVidMem()-AvailVidMem()/(1024*1024))



Addi(Posted 2012) [#4]
freeBeforeLoad# = AvailVidMem()

Graphics 800, 600, 16, 2

...

freeAfterLoad# = AvailVidMem()

Debuglog "Programm uses: "+((freeBeforeLoad-freeAfterLoad)/(1024.0*1024.0))+"mb"

While ...

...

Wend

Last edited 2012

Last edited 2012


Yue(Posted 2012) [#5]
Ok, Thanks.

Text 0,GraphicsHeight()-50,"Capacidad Memoria : " + TotalVidMem()/(1024*1024) + " Megas"
Text 0,GraphicsHeight()-30,"Memoria Usada : " +  Int(TotalVidMem()/(1024*1024)-(AvailVidMem()/(1024*1024))) + " Megas"


Last edited 2012


Yue(Posted 2012) [#6]
Hey one question: The total memory my card is 1 gig, that would be 1024 megabytes right?

However in 1014 megs Blitz returns, where were the other 10 megs??


Yasha(Posted 2012) [#7]
Probably in use by Windows for basic graphics elements?

When you're working out the "recommended specs" for your program, you should take into account that 1) a computer has to do other things in the background, and 2) doesn't want to run at full capacity. If you actually needed 1014MB, you should be telling the user they need 2048, because if they try to run your program with only 1024, they won't have enough left for the rest of the system.


Yue(Posted 2012) [#8]
Interesting, I have always something to learn, however, what reliable returns blitz about the memory used by subtracting the total memory and free memory?, So if my application uses 55 megs the recommendation would be for example a 256 accelerator card memory?

Furthermore as specified processor capacity recommended, for example if I work in a dual processor ...?

Greetings.