1

I have system make to monitoring a multiport hardware and camera, those camera's thread receive data to save images. This system having problem with OutOfMemory, he going allocate memory and have a OutOfMemory in 2 hours, i have 256 MB of heap memory in tomcat.

Waiting ideias, Ty...

1 Answer 1

4

Looks like you have a memory leak in your code, i.e. you are somewhere keeping references to object you no longer need and thereby prevent them from being garbage collected.

To find out which objects are causing the problem and where references to them are kept, use a heap or memory profiler.

The VisualVM tool that comes with newer JDK versions includes a heap profiler that is sufficient in most cases.

Sign up to request clarification or add additional context in comments.

9 Comments

What he says. In addition to that, 256M for a Web application is not that much.
As @Michael and @Elijah, suggest you either have a memory leak, or you really need more memory.
@Elijah, @Peter: It's possible but unlikely that a legitimate lack of memory would manifest only after 2 hours.
As a matter of fact, a "leak" is also a lack of memory. With the difference of being unplanned. But in case he actually needs all that memory for images, insufficient memory will not be visible straight away, it'll take some time to fill up 256M.
@Elijah: The difference is not planned vs. unplanned (who ever planned to have not enough memory?), but whether it's caused by objects that the program still needs to do its work vs. objects that are not actually needed anymore. Both can manifest quickly or slowly depending on the character of the application, but I'd say that memory leaks tend to be of the slowly-manifesting kind and vice versa.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.