.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
Post a Comment