Quote:
Failed to allocate a 9437196 byte allocation with 3044192 free bytes
Your app is trying to allocate all physical memory and more.
You need to discover where and why your app need so much memory, you may have a memory leak, or you don't free memory when you don't need it any more.
The only useful advise is to use the debugger and put breakpoints on key parts of the app to detect where it eats memory. As you get knowledge, move the breakpoints to interesting parts to marrow the research. Then study the code to understand why the app need so much memory.
This is a tedious task and we can't do it for you. The first obvious reason is that we don't have the app.
-----
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.
Debugger - Wikipedia, the free encyclopedia[
^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[
^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[
^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.