0

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 Answers2

1

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!

CSchulz
  • 10,882
  • 11
  • 60
  • 114
MatF
  • 1,728
  • 2
  • 14
  • 31
0

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.

Markus Lausberg
  • 12,177
  • 6
  • 40
  • 66
  • It may just be running out of memory as the syntax coloring support adds a large number of extra objects to track the styles. – greg-449 Nov 22 '13 at 10:27