Hi
Can anyone help me in suggesting how to prevent "out of memory" exception in java. I am getting this exception when I load a very large data in my application and after running the application for sometime the application throws this exception. I want to know if there is any way (such as some parellel thread) that will keep a check for the maximum memory and when the application crosses some threshold (set manually) it will show some popup and exit instead of hanging the application.
Please suggest.
thanks

Java Heap sizing here and here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.