java.lang.OutOfMemoryError

Hi

I am writing an application which takes a stream and converts it into an image with some manipuation on it.

( zooming out the image.)

I have set the zooming to 90% initially.But it throws the following error

java.lang.OutOfMemoryError

I want to catch this Exception,reduce the zoom size and do the manipulation again.

Example:

public double zoom=0.9;

public void f1(){

try{

//

//

//zoom the document to (zoom*100)%

//

//

}

catch(java.lang.OutOfMemoryError){

//reduce the zoom

//call function f1 to do all manipulations again

//

}

}

Explanation:Consider f1 be the function throwing the exception.I have caught the exception.But the issue remains is that memory is not getting free and the exception is thrown again and again.

How should I free the memory and avoid this error.

Thank you,

Ketan.

[953 byte] By [ketchara] at [2007-10-2 1:22:15]
# 1
If you increase the maximum memory, do you still get the problem.Have you tried a memory profiler to find the source of your memory leak.
Peter-Lawreya at 2007-7-15 18:43:43 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...