Community
Participate
Working Groups
Created attachment 255583 [details] Error popup Hi, I have a big update script in my project. It is impossible to edit it with Eclipse. Steps to reproduce : 1) create a PHP file using one of the two scripts given below. 2) add the generated file to your project 3) open the PHP file in eclipse (freezes ~5mins) 4) try to edit it (freezes ~5mins and an error popup appears - see attached file) Maybe there is some buffer or hashmap which size is fixed to some small/medium value and doesn't depend of size of parsed file. Let me know if I can help further. Best regards, Laurent Lyaudet first script : <?php $sTexte = "<?php\n\$array = array();\n"; for($i = 0; $i < 40000; ++$i){ $sTexte .= "\$array []= \"It's a big string you know. Of course I know.\";\n"; } $sTexte .= '?>'; file_put_contents('testArray.php', $sTexte); ?> second script : <?php $sTexte = "<?php\n\$array = array(\n"; for($i = 0; $i < 40000; ++$i){ $sTexte .= " \"It's a big string you know. Of course I know.\",\n"; } $sTexte .= ");\n?>"; file_put_contents('testArray2.php', $sTexte); ?>
It looks more like DLTK issue. Problem is around hashmap inside org.eclipse.dltk.internal.core.ModelCache.
(In reply to Michal Niewrzal from comment #1) > It looks more like DLTK issue. Problem is around hashmap inside > org.eclipse.dltk.internal.core.ModelCache. Yes and no. We generate 40k local fields here.
True, I will look at it.
For this case we can exclude ArrayVariableReference from Assignment processing in PHPSourceElementRequestor. This information is not used anywhere, at least I think so :) With this we still need to work with editor stability because from time to time PDT is freezing. It is not related to this issue, but more to file size (2MB+). One file like this can consume huge amounts of memory.
New Gerrit change created: https://git.eclipse.org/r/53365
Gerrit change https://git.eclipse.org/r/53365 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=491892061ac5e95606fe1d12b4227f48e38acdb5
I think I fixed main problem with freezes and now it should be usable. If you will face something else related to performance just reopen this issue.
Looks OK now, closing
I'll reopen this one, see my comment for bug 298943: "Sadly I still see UI freezes when you take sample file testArray.php from bug report 474115. Just click on "$array" and wait on highlighter to highlight all "$array" occurrences, UI will freeze for several minutes."
Some additional infos: problems about UI freezes with sample file testArray.php lies in method PHPStructuredEditor#OccurrencesFinderJob.run(IProgressMonitor progressMonitor) when calling following code: ((IAnnotationModelExtension) annotationModel).replaceAnnotations(fOccurrenceAnnotations, annotationMap); If I take code (and adapt it) from JDT method JavaEditor#OccurrencesFinderJob.run(IProgressMonitor progressMonitor), it's even worse. So it's maybe a general problem in eclipse. Any good solution is welcome ;)
I collected couple issues: 1. Additional freeze on window focus - already fixed in HEAD 2. Problem with replace annotations - DLTK AnnotationModel is extremely slow due ReverseMap implementation, same problem have JDT and has been informed, will see what they do 3. OverviewRuller collect annotation for painting without synchronisation, due this for each one (warning, occurrence etc...) wait for lock. If during waiting DLTK perform long replaceAnnotations with lock, UI have to wait...
New Gerrit change created: https://git.eclipse.org/r/161863
New Gerrit change created: https://git.eclipse.org/r/161871
Gerrit change https://git.eclipse.org/r/161863 was merged to [master]. Commit: http://git.eclipse.org/c/dltk/org.eclipse.dltk.core.git/commit/?id=6058f69b3568a0b43e1a8c7e1459c3bb80c66dfe
Gerrit change https://git.eclipse.org/r/161871 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=b3a733b34f245a5db889156c743dcd7d428d7f30