Question

I'm using Google App Engine v.1.9.1, Java edition, running inside Eclipse Kepler SR2. I've got JDK 1.7. My logging.properties is sending the logs to the java.util.logging.ConsoleHandler only.

My [edit] development server running in Eclipse [/edit] receives a lot of data from another server and just dumps it into a database. This generates a lot of logs. I get OutOfMemoryError after only a few hours.

I've run JProfiler and I figured out the object being kept around is com.google.apphosting.api.logservice.LogServicePb$LogLine. Somehow this isn't being discarded, ever, keeping millions of instances in memory.

Sure I can reduce the amount of data logged but that will only delay the problem.

I've looked everywhere to figure out how to flush out the log lines but I can't find any setting for this. The only option available is for Python not Java.

Any idea what's causing this and how to fix it?

Was it helpful?

Solution

As @Martin Berends said, the development server inside Eclipse is only for developing. It seems that log statements are kept in memory in that environment. Once I moved my app to a test server, the memory usage seems to be flat.

So the bottom line is; when running in a development environment, reduce the amount of logging and restart the server once in a while to avoid OutOfMemoryErrors. Secondly, do your tests on a real test server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top