userInThisWorld
userInThisWorld

Reputation: 1391

Java. lang out of memory

I ran a script on MATLAB and it worked fine, when i want to run the script again, then MATLAB stuck in busy! i found a file "hs_err_pid1124" in the directory i works in it contain the following:

A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 16384000 bytes for GrET in  
C:\BUILD_AREA\jdk6_17\hotspot\src\share\vm\utilities\growableArray.cpp. Out of swap  
space?
#
#  Internal Error (allocation.inline.hpp:39), pid=1124, tid=1380
#  Error: GrET in 
C:\BUILD_AREA\jdk6_17\hotspot\src\share\vm\utilities\growableArray.cpp
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode windows-x86 )

. 
.
.

My computer RAM is 4G, i increased the System Swap Space, but still the problem not solved!!

Thanks,

Upvotes: 0

Views: 163

Answers (1)

Dennis Jaheruddin
Dennis Jaheruddin

Reputation: 21563

The most likely suspect here is your code. I would expect you to do something strange (opening a file, and not closing it later?! Reading each file into a continiously growing variable?!).

However, without code this is hard to diagnose.

Here is what you can do:

  1. Evaluate the visible memory usage: Put a breakpoint somewhere halfway through, and inspect the size of the largest variables. Also check the total size. (If the error is a regular matlab error, you could also use dbstop if error)
  2. Persuade matlab to release memory: If step 1 yields nothing, you may actually be doing things right, but perhaps matlab does not manage its memory properly. This is rare, but occurs sometimes when repeating simple tasks a lot of times. In this case you can place the pack command somewhere in your code. Probably it will help.

Upvotes: 1

Related Questions