I have a Java application that is run as a background process to a Windows Service application.
When issuing a console output statement, such as
System.out.println, where does that output get stored. Does it get stored in Windows storage, or does it remain in the JVM heap storage?
Best How To :
The answer has been found.
A third-party library had a method that was not turning off console output of the log4j logging when a customer
Appender was created. There were two methods to accomplish this, only one of them performed the operation properly.
I switched to the second method and the console messages stopped when the custom
Appender was created. I re-ran the job that was failing after 18 hours. Right now, it is at 3.5 days (84 hours) and still going strong.
Therefore, it can be determined that if there is no process that will take the console output (
System.out), those output messages will be stored by the JVM in heap storage. Eventually the JVM heap storage will be exhausted and the application will crash.