java - Avoid OutOfMemory when creating an image -


i want create bufferedimage in java-application. users allowed change dimensions of image , allow images "as big possible". how can check, whether creating bufferedimage cause outofmemory-exception , recover it?

use runtime.getruntime().freememory() check free memory of jvm instance. , based on value can add restrictions dimensions future image.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -