.net - is it possible to figure out if there is enough memory available before creating a huge bitmap? -


sometime, can create 10000x10000 bitmap, sometime can't

depending on how available physical ram free

i know if there way figure out before process start if there enough memory or not

you can use current process:

process proc = process.getcurrentprocess(); 

and use private memory usage:

proc.privatememorysize64; 

you (using system.diagnostics.performacecounter):

protected performancecounter ramcounter;  ramcounter = new performancecounter("memory", "available mbytes"); var freeraminmb = ramcounter.nextvalue(); 

the above the amount of free ram in mb...


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -