Application is crashed, to open large file size (>18MB) in editor in eclipse?

350 Views Asked by At

I have a created a editor with syntax (keyword, comments, etc) with different coloring support. Using this editor, if we open large size file (>18 MB) then it get crashes. I think It seems out of memory problem.

When I did to open the file without syntax coloring (disable), we have used TextEditor API to open the file and it seems to be working fine.

But when I tried with same API and include some coloring feature in editor an try to open same file (>18MB). The application has crashed.

Any idea why this is crashing?

Thanks,

2

There are 2 best solutions below

0
On

This is just a guess, as you haven't shown any of your code: Is it possible that you create new Color objects everytime?
You could try using the native colors i.e. display.getSystemColor(SWT.COLOR_CYAN) or use a color registry http://help.eclipse.org/helios/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/resource/ColorRegistry.html for managing your own color objects.

Remember: System-Colors may not be disposed manually!

1
On

first of all, search for a crash log file named 'hs_err_pid' and try to get some informations from it

As you described, that you use coloring i can imagine that you run out of handles. if the colors/fonts/icons are not disposed, but created all the time, the system runs out of handles and can not create new UI components anymore.