Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 47879 - OutOfMemory/NullPointerException
Summary: OutOfMemory/NullPointerException
Status: RESOLVED DUPLICATE of bug 33972
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-02 07:58 EST by Vidar CLA
Modified: 2003-12-02 12:28 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vidar CLA 2003-12-02 07:58:53 EST
This is the first excerpt today from my .log file (in
C:\Program Files\eclipse\workspace\.metadata\.log to be precise)

There are a lot of more problems today too.

!SESSION Dec 02, 2003 09:53:58.70 ----------------------------------------------
java.version=1.4.2_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -Xms128m -Xmx512m -
install file:C:/Program Files/eclipse/
!ENTRY org.eclipse.ant.core 4 1 Dec 02, 2003 09:53:58.70
!MESSAGE BUILD FAILED
!STACK 0
java.lang.OutOfMemoryError
!ENTRY org.eclipse.ant.core 4 1 !ENTRY org.eclipse.ui.workbench 4 2 Dec 02, 
2003 10:14:44.07
!MESSAGE Problems occurred when invoking code from plug-
in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
	at java.lang.System.arraycopy(Native Method)
	at org.eclipse.swt.widgets.Table.getItems(Table.java:859)
	at org.eclipse.jface.viewers.TableViewer.internalRefresh
(TableViewer.java:448)
	at org.eclipse.jface.viewers.TableViewer.internalRefresh
(TableViewer.java:431)
Comment 1 Grant Gayed CLA 2003-12-02 09:47:25 EST
Do you have any idea which steps led to this exception occurring?
Comment 2 Carolyn MacLeod CLA 2003-12-02 12:28:26 EST
OutOfMemoryError exceptions occur because the default amount of virtual memory 
allocated by the java VM is typically not enough for an all-out, intensive 
eclipse session. When an OutOfMemory error happens, random additional 
errors/exceptions can occur (like NullPointer inside a native). In this case, 
looking at Table.getItems, the most likely thing that happened is that this 
line of code failed:
	TableItem [] result = new TableItem [count];
And this is something that can't really be protected against, other than 
catching the error way up in eclipse somewhere, and getting the user to help 
get more memory somehow.

Eclipse is not (currently) very good at helping the user figure out what to do 
in this situation. Sometimes, an OutOfMemory dialog is brought up, and 
sometimes, an OutOfMemory error is just silently logged and some other strange 
error/exception halts the session.

Searching for "OutOfMemory" in the Bugzilla database, it looks like there are 
several open bug reports requesting that eclipse handle this better somehow:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=22026
https://bugs.eclipse.org/bugs/show_bug.cgi?id=23633
https://bugs.eclipse.org/bugs/show_bug.cgi?id=33972
https://bugs.eclipse.org/bugs/show_bug.cgi?id=30807

Please read these bug reports to see how to increase the virtual memory in 
your java vm when running eclipse. I will mark this bug report as a duplicate 
of those others. Feel free to add a comment to any of those bug reports if you 
would like to.

*** This bug has been marked as a duplicate of 33972 ***