Memory leak : heap usage grow on inserting charactere
Simply by adding few characteres (keep keyboard press some time), we can notice (in heap status bar) that memory grow by Mo.
For simple case run GC will restore the heap at original state.
But for a more complexe project (eg scalaIDE itself) I do the following step then memory is consume and not freed:
I attach I capture of a delta usage made (last night with jvisualvm) during the test.
And this case can be more or less visible (seems to be related to the size/complexity(??) of the project), so quickly Eclipse become unusable due to lack of memory on a daily project.
Currently I was not able to reproduce the issue with "simple" reproductible case.
Investigations :
Any suggestion ?
For simple case run GC will restore the heap at original state.
But for a more complexe project (eg scalaIDE itself) I do the following step then memory is consume and not freed:
- Display Heap in status bar (preferences > General)
- Open ScalaPresentationCompiler
- Open ScalaCompilationUnit
- Move caret after some method (eg after the last '}' of reportMatches)
- Run GC (note the memory size used)
- insert few character (keypress), pause (1s), remove, pause (1s), insert, pause (1s).......
- notes
- how memory increase in Mo quickly for few characteres insertions
- all call to newTyperRun and how same files are read and re-read at every newTyperRun (if Tracer enabled)
- Run GC
- notes that memory is not restored at same size, but higher !!
I attach I capture of a delta usage made (last night with jvisualvm) during the test.
And this case can be more or less visible (seems to be related to the size/complexity(??) of the project), so quickly Eclipse become unusable due to lack of memory on a daily project.
Currently I was not able to reproduce the issue with "simple" reproductible case.
Investigations :
- The memory delta (may by sampling) and a previous investagion (not shared) show that there is may too heavy memory retention of Type, TypeRef (interactionWitness)
- I'll try to find a fix/workaround at scalaIDE level (and I'll raise bug to scalac if the cause in it)
- try to reproduce the behavior with no TypeLevelMap28, with a newTyperRun that reuse existing TyperRun
- try to reproduce the behavior with no ScalaPresentationCompiler
Any suggestion ?
Leave a comment
memory delta when inserting 'aaaaa....'
on 2011-01-28 05:08 *
By David Bernard
Summary changed from Memory leak : heap usage grow on inserting caractere to Memory leak : heap usage grow on inserting charactere
on 2011-01-28 06:37 *
By Iulian Dragos
What version are you using? Some issues were solved in the trunk version of the Scala compiler (for instance, intersectionWitness). Let me know if the same happens with wip_experiment...
on 2011-01-28 07:08 *
By David Bernard
wip_exp_backport use only released scala version (except for package scala.tools.nsc.interactive). In this case 2.8.1
Great to hear that intersectionWitness was fix (then I'll not have to check in the trunk version nor open a bug, ... less work :-) )
Great to hear that intersectionWitness was fix (then I'll not have to check in the trunk version nor open a bug, ... less work :-) )
Updating tickets (#1000199, #1000200, #1000201, #1000204, #1000205, #1000209, #1000210, #1000211, #1000212, #1000215, #1000217, #1000218, #1000220, #1000222, #1000226, #1000227, #1000228, #1000230, #1000231, #1000232, #1000233, #1000235, #1000236, #1000237, #1000239, #1000240, #1000241, #1000242, #1000243, #1000244, #1000248, #1000249, #1000252, #1000253, #1000254, #1000255, #1000256, #1000258, #1000259, #1000032, #1000059, #1000062, #1000163, #1000197, #1000216, #1000221, #1000224, #1000121, #1000175, #1000219, #1000251, #1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408)
Ticket assignment reverted due to inactivity.