-1

I have ran the performance test of my java application for two days and monitored through JConsole. However After the test ran for a day; JConsole output window reports OutOfMemoryError and JConsole hangup.

Q1) Is it becasue of my application OR Jconsole problem?
Q2) How to resolve this ? Is there any way to increase the HEAP memory of JConsole?
Q3) If it is due to long run then how can i set time range to disconnect the remote connection after sometime (not closing/killing)?

Please help.

enter image description here

enter image description here

Kanagavelu Sugumar
  • 18,766
  • 20
  • 94
  • 101

1 Answers1

1

That stack trace makes it pretty obvious that JConsole is running out of memory when setting text to the window.

Unfortunately there's no command line options to configure that. There may be an MBean in JConsole that allows you to configure it, but I'd guess that there isn't.

Your alternatives are

  1. to close the console output, and just open it when you need it, or
  2. to redirect your application's stdout and stderr to files, so that the console output never has anything in it.
Paul Hicks
  • 13,289
  • 5
  • 51
  • 78
  • Is there anyway i can redirect this output to a file, and go ahead for days range? – Kanagavelu Sugumar Nov 10 '14 at 06:46
  • Couldn't find anything in the command-line interface for limiting the size of the output. Try attaching to the JConsole application itself and see if it present an MBean to configure it. More likely, you'll have to close the output window and live without the text console. That window just captures what your application sends to stdout and stderr, so if you start your monitored application with the correct redirection, you shouldn't have any issues. – Paul Hicks Nov 10 '14 at 06:47
  • Also please tell me is there a way to stop my jconsole after some time by programatically? . – Kanagavelu Sugumar Nov 10 '14 at 06:48
  • That's sort of a separate question. But JConsole does offer an MBean for that, I'm pretty sure (I know jvisualvm does). – Paul Hicks Nov 10 '14 at 06:50
  • +1 Thanks for your response. However note that the text/output window is off when i start, even i dont know how to open that, i think it get opened once it reaches OME. – Kanagavelu Sugumar Nov 10 '14 at 06:53
  • It's opened when your application outputs something to stdout or stderr. So if you manually redirect your application's stdout and stderr, it shouldn't open at all. – Paul Hicks Nov 10 '14 at 07:10