Page 1 of 1

OutOfMemory error reloading same file

Posted: Fri Nov 22, 2013 1:08 pm
by malvarez
Hello, I think I've found a memory leak on Oxigen editor that throws OutOfMemory exception when editing single xml files. Let me explain how I reproduce such error:
I'm generating an XML file outside Oxigen (from an Eclipse java project) and I open it inside Oxigen Editor to view it's content, then I regenerate such XML file with some minor changes with my Eclipse project and when I switch back to Oxigen it states to reload such xml file because it's contents have changed, I do so and review newly generated file. I keep doing this loop several times until Oxygen throws an OutOfMemory exception.
I've opened memory status panel and every time I reload xml file it increases used memory use in about 40 megs, such value doesn't decrease until program crashes. My XML file weights 7 Mb.

Note: I've increased Oxygen maximum memory from 512 to 1024 but it still consumes all assigned RAM. Then another type of message appears pointing:
"The application exceeded the available memory: 910MB. To avoid stability issues please restart the application. If the application has become unstable and cannot be closed normally, you can use the Force Quit button from this dialog. Be aware that by doing this you will lose any unsaved documents.
If the problem persists, it is recommended to increase the amount of memory available to the application."

Thank you in advance.

Re: OutOfMemory error reloading same file

Posted: Fri Nov 22, 2013 1:14 pm
by malvarez
Oh, I forgot to say I use Oxigen Editor 15.1

Re: OutOfMemory error reloading same file

Posted: Fri Nov 22, 2013 3:39 pm
by adrian
Hi,

While this is not a memory leak, it is a known problem of the undo history feature from Oxygen.
The undo history allows you to undo even files modified and reloaded from the file system. However it is limited only by the number of undo steps (by default 200), it does not account for the memory used by each of these undo steps. So, when each item has a significant size (as is the case with the entire reloaded file), it can consume a lot of memory and eventually run out.
We already have this problem logged on our issue tracking tool and we will try to find a solution in a future version of Oxygen.

Meanwhile, if you want to avoid this, I recommend decreasing the value of the option Undo history size from Options > Preferences, Editor to 10 or 20.
Another option that affects the undo history is Clear undo buffer on save from Options > Preferences, Editor / Open/Save. Note that if you enable this, after you save a file you won't be able to undo (history gets cleared).

On another note, since you mentioned you use Eclipse, you could also install and use the Oxygen Eclipse plugin. Eclipse manages undo history differently (it keeps it in the file system, not in memory), so the Oxygen Eclipse plugin is not affected by this problem.

Regards,
Adrian

Re: OutOfMemory error reloading same file

Posted: Mon Nov 25, 2013 11:08 am
by malvarez
Thanks for your fast reply, I'll configure undo operations as you stated to avoid such error.
I've also considered using eclipse plugin but I still prefer standalone Oxygen editor interface because it delivers more functionality at a glance.
Thank you again.