Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basically, I think you are barking up the wrong tree:</p> <ul> <li><p>The JVM / GC <em>will</em> manage to deallocate unreachable objects, no matter how fast you allocate them. If you are running the classic non-concurrent GC, then JVM will simply stop doing other things until the GC has deallocated memory. If you configured your JVM to use a concurrent GC, it will try to run the GC and normal worker threads at the same time ... and revert to "stop everything and collect" behaviour if it cannot keep up.</p></li> <li><p>If you are running out of memory, it is because something in your application (or the libraries / drivers it is using) is leaking memory. In other words, something is causing objects to remain reachable, even though your application doesn't need them any more.</p></li> </ul> <p>As comments have pointed out, you need to address this problem methodically using a memory profiler / heap dump. Randomly changing things or blaming it on the GC is highly unlikely to fix the problem.</p> <p>(When you say <em>"... I did use stmt.close() all the time"</em>, I assume that this means that your code looks something like this:</p> <pre><code> PreparedStatement stmt = ... try { stmt.execute(); // ... } finally { stmt.close(); } </code></pre> <p>If you don't put the <code>close</code> call in a <code>finally</code> then it is possible that you are NOT calling <code>close</code> every time. In particular, if some exception gets thrown during the <code>execute</code> call or between it and the <code>close</code> call, then it is possible that <code>close</code> will not get called ... and that will result in a leak.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload