title: Eclipse running out of memory and running slow
body: <p>Although I've found similar questions, I've seem to run out of suggestions and thought of asking SO for what I've left to do. </p>
  
  <p>I am running out of memory while using Eclipse and it starts to crawl after a couple hours to the point where I have to Force Quit. Initially it would hang and say things like "heap space out of memory." I searched on SO for things like: </p>
  
  <pre><code>Eclipse indexer hangs with 100% cpu
  Eclipse running out of memory
  Eclipse java heap space out of memory
  </code></pre>
  
  <p>So I started to incorporate all of the suggestions, with negligible improvement.  Here are all of my current changes.</p>
  
  <p>I've been running eclipse with <strong>eclipse -debug .options</strong> so I can check memory usage</p>
  
  <p>where the .options file has:</p>
  
  <pre><code>org.eclipse.cdt.core/debug/pdomtimings=true
  org.eclipse.cdt.core/debug/indexer=true
  org.eclipse.cdt.core/debug/parser=true
  org.eclipse.cdt.core/debug/deltaprocessor=true
  org.eclipse.cdt.core/debug/scanner=true
  org.eclipse.cdt.core/debug/model=true
  </code></pre>
  
  <p>I've updated my <strong>/etc/eclipse.ini</strong> file to say (was before -Xmx384m so max size is much larger now)</p>
  
  <pre><code>openFile
  -vmargs
  -XX:MaxPermSize=256m
  -Xms40m
  -Xmx2048m
  </code></pre>
  
  <p>I've also updated the indexer options (Window -> Preferences -> C/C++ -> Indexer)</p>
  
  <pre><code>Cache limit relative to heap size: 25%
  Absolute limit: 256 MB
  Header file cache: 256 MB
  </code></pre>
  
  <p>I also unchecked Project -> Build Automatically because on any change it would momentarily hang and build the workspace</p>
  
  <p>I've also updated the history options (Window -> Preferences -> General -> Workspace -> Local History)</p>
  
  <pre><code>Days to Keep files: 1
  Maximum entries per file: 50
  Maximum file size (MB): 1
  </code></pre>
  
  <p>Lastly, in the resource filter (Project -> Properties -> Resource -> Resource Filters) I told it to ignore indexing files and folders that match *dox</p>
  
  <pre><code>Exclude all: Name matches *dox (file and folders)
  </code></pre>
  
  <p>When it starts to get super slow I'll hit ctrl + \ where I ran eclipse and I'll see that its using 100% of the heap space.  Trying to increase the maximum size (-Xmx) beyond 2048 MB results in it complaining that it can't start the VM, but I'm wondering if this isn't exactly a case of how much space I give it.</p>
  
  <p>I keep the progress window open so I can see what it's trying to do, and usually it seems to get slower while indexing, but when it's crawling, it'll be so bad that merely scrolling seems to make it hang. I usually have no choice but to close Eclipse and reopen (after about 2 hours).</p>
  
  <p>What else is there left to try? Is this solely a memory issue? What else can lead me to discovering why it starts to crawl?</p>
  
  <p>This is on Ubuntu 12.04 and Eclipse 3.7.2 and Java OpenJDK 1.6.0_30-b30</p>