Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #344652 +++ +++ This bug was initially created as a clone of Bug #344031 +++ +++ This bug was initially created as a clone of Bug #117746 +++ Loading large files in an editor needs a lot of memory (up to 5 times the file size, see Bugzilla 75086), so the Workbench can run into an OutOfMemory error or freeze for some time while an editor is busy loading a file. Since users do not see in the Resource navigator how large a file is, it can easily happen that one tries to open a very large file by accident. We have auto-generated log files which range from 1 to 400 MB in size. The smaller ones we want to open in Eclipse Workbench, the larger ones we open in an external editor. Trying to opening a 400MB file in the Workbench by accident leads to an OutOfMemoryError and destabilizes the workbench or even makes it unusable for some time. It should be possible to define a maximum file size (in the Preferences, in plugin.xml or by computing available heap size) up to which an editor editor can open a file directly. If the user tries to open a file that exceeds the given size, the user should be shown a dialog which allows to * Open the file in spite of the warning * Open the file in an alternative (external) editor instead * Cancel the edit request Perhaps the best solution would be to extend the Editor API such that an editor is given the file path to be opened BEFORE it is actually opened. Thereby, each editor implementor could have policies for allowing or denying the open request. Policies for denying could be based on file size, virtual vs. real file system [See Bugzilla 106176], file content...) In case an edit request is denied, the Platform could show a dialog like "Editor FooBar has denied opening 'yourFile.xxx' with the following message: (Custom Message e.g. File is 50MB large) Do you want to * Open the file in (Dropdown of registered editors for xxx files) instead * Open the file in spite of the warning * Cancel "
Created attachment 194677 [details] Patch v01 Patch v01 for R3_6_maintenance branch
Patch installs fine. I'll upload it to our site soon. Duong, can you check this for legal? Thanks
(In reply to comment #1) > Created attachment 194677 [details] [diff] > Patch v01 > > Patch v01 for R3_6_maintenance branch Note that this is not the final patch that will be released. The additional fix from bug 344031 comment 20 will also be released to the branches.
Prakash, can you please finish this, so that we have the right fix in all streams? Thanks.
Comment on attachment 194677 [details] Patch v01 This patch is obsolete. The change from 3.7: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R3_7_maintenance&id=dc09e4cc9c5dea3bfb116664884242ed1b4da9d1 should simply be applied to 4.x.
Ping, what is the status of this ?
Nothing will be done for 3.6.2+ at this point. For 4.x see bug 117746.