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