Summary: | OOM Exception in search cause IDE freeze | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | jerome_lanneluc |
Version: | 2.1 | ||
Target Milestone: | 2.1 RC1 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Dirk Baeumer
2003-01-20 07:47:39 EST
Why do you think a maximum heap of 10MB is a valid testcase ? This was a randomly choosen number. We had a PR that refactoring behaves strange when runing out of memory and I discovered this bug as a side effect. IMO it happens in any case when search runs out of memory. Feels like we are missing some finally block somewhere to release a lock. Removing the milestone, good candidate during test pass. According to the Thread dump, the OutOfMemoryError occured in the 'Java indexing' thread (it is missing). JobManager.run(...) should have a finally block that set activated to false and awaitingJobsCount() should return 0 if not activated. JobManager.run() already protects itself & tries to restart the indexing thread whenever any RuntimeException is caught. What's a finally block going to do? Also if awaitingJobsCount() answers 0, then performConcurrentJob() will work differently. An OutOfMemoryError is not a RuntimeException. The idea of the finally block is to empty the queue of jobs so that another thread which is actively waiting for the jobs to finish is not blocked as this bug reports shows. Just being curious, when trapping RuntimeException, why don't we always rethrow it after having done what's necessary ? In case the thread is null, we will silently absorb it. Feels wrong on the surface. Added another exception handler (same as the one for RuntimeExceptions) for all Errors (except ThreadDeath). We will now create a new background indexing thread which will start with an empty jobs queue. Any concurrent job waiting on the indexing thread will run but find inconsistent results. Verified. |