whine: out of memory

sorry, but this is lame:
when app ran via IDEA produces huge amounts of System.out IDEA just freezes on Out Of Memory.

Please fix it & have a nice weekend :)

23 comments
Comment actions Permalink

maybe I should add: in my case it additionally were
huge amounts of stack traces...

0
Comment actions Permalink

Modify idea.lax, and change the -Xmx value to a higher one, say 512M

0
Comment actions Permalink

Nick Pratt wrote:

Modify idea.lax, and change the -Xmx value to a higher one, say 512M

That just delays the problem.

The point is that IDEA should not freeze on Out of Memory. It should be
detected and handled gracefully.

0
Comment actions Permalink

Tim Haley wrote:

The point is that IDEA should not freeze on Out of Memory. It should be
detected and handled gracefully.

Now that's sound interesting! If you'd tell me how this could be handled
gracefully and reliably I'd be grateful for the rest of my life ;)


--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Hello Maxim,

I saw this the other day. I haven't had a chance to try it out yet, but it looks intriguing. Yes, it does require the 5.0 JDK, but we all know IDEA is going to run under 5.0 anytime now, right? ;)

http://www.javaspecialists.co.za/archive/Issue092.html

(and as a plug for this site, I've been very impressed with their content in general)

Tobin

Tim Haley wrote:

>> The point is that IDEA should not freeze on Out of Memory. It should
>> be detected and handled gracefully.
>>

Now that's sound interesting! If you'd tell me how this could be
handled gracefully and reliably I'd be grateful for the rest of my
life ;)


-- Posted by JetBrains Omea

0
Comment actions Permalink

Tobin Juday wrote:

Hello Maxim,

I saw this the other day. I haven't had a chance to try it out yet, but it looks intriguing. Yes, it does require the 5.0 JDK, but we all know IDEA is going to run under 5.0 anytime now, right? ;)

http://www.javaspecialists.co.za/archive/Issue092.html

(and as a plug for this site, I've been very impressed with their content in general)

Tobin

>>Tim Haley wrote:
>>
>>
>>>The point is that IDEA should not freeze on Out of Memory. It should
>>>be detected and handled gracefully.
>>>
>>
>>Now that's sound interesting! If you'd tell me how this could be
>>handled gracefully and reliably I'd be grateful for the rest of my
>>life ;)
>>


-- Posted by JetBrains Omea


The solution presented by Dr. Kabutz sounds like the appropriate solution.

However, in the absence of JDK 5.0, what about using values that IDEA
already has.

IDEA displays the memory usage in the status bar, which it most likely
got from java.lang.Runtime and since IDEA is started from a batch, shell
script, or LAX file, you can get at the value set for -Xmx

When the memory usage starts to creep up close to the max heap size,
attempt to invoke GC and then display a warning with the option to exit.
If you actually receive an OutOfMemoryError, catch it and exit.

It's not fool proof, and it may even be a bit conservative, but it would
be better than ignoring the problem.

0
Comment actions Permalink

Piffle. What does your car do when it runs out of gas?

Your app produces all this output.
Its all captured by IDEA, and displayed in the run buffer.
This all takes memory.

Two fixes:
1. Dont produce such volumnes of output
2. Increase the max heap usage by using the -Xmx argument.
3. Log the output to a file

What other options do you have? Maybe we should have a cyclic buffer for the console output? No thanks, I like seeing all my output in there, and I dont want to run the risk of losing it.



0
Comment actions Permalink



On 8/20/04 2:37 PM, in article cg5gci$vvr$1@is.intellij.net, "Tobin Juday"
<tsjuday@checkfree.com> wrote:

Hello Maxim,

I saw this the other day. I haven't had a chance to try it out yet, but it
looks intriguing. Yes, it does require the 5.0 JDK, but we all know IDEA is
going to run under 5.0 anytime now, right? ;)


That better not happen until:
1- JDK 5.0 is not beta

2- All platform have an appropriate JDK5.0 implementation to work with.

:-\

R

0
Comment actions Permalink

Well said Nick...

R

On 8/20/04 4:10 PM, in article
23384622.1093032640336.JavaMail.itn@is.intellij.net, "Nick Pratt"
<no_mail@jetbrains.com> wrote:

Piffle. What does your car do when it runs out of gas?

Your app produces all this output.
Its all captured by IDEA, and displayed in the run buffer.
This all takes memory.

Two fixes:
1. Dont produce such volumnes of output
2. Increase the max heap usage by using the -Xmx argument.
3. Log the output to a file

What other options do you have? Maybe we should have a cyclic buffer for the
console output? No thanks, I like seeing all my output in there, and I dont
want to run the risk of losing it.




0
Comment actions Permalink

1- JDK 5.0 is not beta


Which means until JDK 1.5.1 is available.

Tom

0
Comment actions Permalink

before my car runs out of gas it lights a lamp.

a cyclic buffer would be fine for me, instead of
freezing. In the latter case ALL my output is lost.
If you are interested in more output that fits unto the
buffer you should log to file, as you proposed.

From "The Most Intelligent Java IDE" I expect more than
what happens currently...

Cheers ;)

0
Comment actions Permalink



On 8/21/04 1:29 AM, in article cg6mic$ods$1@is.intellij.net, "Thomas Singer
(MoTJ)" <idea@NOregnisSpam.de> wrote:

>> 1- JDK 5.0 is not beta


Which means until JDK 1.5.1 is available.


Yup, and will avoid many headaches for the JB team dealing with existing
bugs etc...

R

0
Comment actions Permalink

Seems like there IS a red lamp in IDEA, just look at the bottom right and
look at your memory. Stop your app before it runs out of memory, and drop
by a gas station like you would with your car! :)

R

On 8/21/04 7:00 AM, in article
14591857.1093086004461.JavaMail.itn@is.intellij.net, "Michael Damberger"
<michael.damberger@t-online.de> wrote:

before my car runs out of gas it lights a lamp.

a cyclic buffer would be fine for me, instead of
freezing. In the latter case ALL my output is lost.
If you are interested in more output that fits unto the
buffer you should log to file, as you proposed.

From "The Most Intelligent Java IDE" I expect more than
what happens currently...

Cheers ;)


0
Comment actions Permalink

joker ;)

I'm debugging a repaint-problem for a graphical map display.
The problem occurs when I resize the frame. I'm interested
in the debug output that occurs when resizing the frame.
So, inbetween resizing the frame, I should switch to
IDEA and look at the red lamp ?

The debug output is kind of huge because I patched the JDK
to output debug stack traces for each event posted to the EventQueue (to see where it came from).
But it is not really THAT huge, I estimate max 5MB when saved to text.

0
Comment actions Permalink

Michael Damberger wrote:

The debug output is kind of huge because I patched the JDK
to output debug stack traces for each event posted to the EventQueue (to see where it came from).
But it is not really THAT huge, I estimate max 5MB when saved to text.


Write the debug output to a file and then view it in a text editor
capable of handling large files. Console output is too transient for
reliable scanning and tracking of problems through debug output.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

for better analyzing I used to copy IDEAs console output
to text editor...

Yeeessss, just putting stacktraces to System.err was the quick + dirty approach.

IDEA just should not suddenly freeze, even if my app
produces tons of output, IMHO



0
Comment actions Permalink

I thought the quick and dirty approach was -Xmx512M...


0
Comment actions Permalink

Guess what, I'll try -Xmx512m just to find out if IDEA
behaves better then - although my bug is fixed in the
meantime ;)

0
Comment actions Permalink

ok, I tried it: and it seemed to help, I could run my
app really long without problems, memory did only go
around 200m.

Then I tried "Copy Content" of the console output in IDEA
-> memory crept up to 850m (where it stopped due to only
512m RAM) & IDEA locked up...

so really "Copy Content" is evil ;)

0
Comment actions Permalink

Michael Damberger wrote:

ok, I tried it: and it seemed to help, I could run my
app really long without problems, memory did only go
around 200m.

Then I tried "Copy Content" of the console output in IDEA
-> memory crept up to 850m (where it stopped due to only
512m RAM) & IDEA locked up...

so really "Copy Content" is evil ;)


I'd be curious to know what happens if you output all that debug stuff
to a file, open the file in a text editor, select all and copy to clipboard.

You must admit it's a pretty extreme use-case.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

not that extreme. it is certainly not 650MB in the clipboard, or anything near.
Rather 1-5MB, copied 5-8 times.

During my last check it may have been more than 5MB,
maybe 15-20, but copied only once.

0
Comment actions Permalink

Michael Damberger wrote:

not that extreme. it is certainly not 650MB in the clipboard, or anything near.
Rather 1-5MB, copied 5-8 times.

During my last check it may have been more than 5MB,
maybe 15-20, but copied only once.


Ah, I see. And using Copy Content pushes IDEA memory up to 850MB? That
does sound like a bug to me.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

for those who might be interested: There's an easier way
to debug the event queue (than patching the JDK):

EventQueue dbgQueue = new DebugEventQueue(); Toolkit.getDefaultToolkit().getSystemEventQueue().push(dbgQueue);

DebugEventQueue overrides the original EventQueue
and you can e.g. use log4j for debug output

I took this from http://www.javaworld.com/javaworld/javatips/jw-javatip87.html

0

Please sign in to leave a comment.