1

I'm writing an App Engine Java application in Eclipse. So far, it has been just playing with datastore and JDO, the application doesn't do anything serious. However after about an hour of developing I end up with java.lang.OutOfMemoryError error.

I've read that this error is most likely caused by some kind of memory leak. For testing I tried to speed up things a little bit and force the error to appear. Using wget I made around 3000 request to the same urls as during the development in Eclipse. But nothing happened. I assume that if there was really a memory leak, I would see it this way...

Is it possible hat this error is really caused by the development process? I use the trick with touching appengine-web.xml, so every time I change and save a file the server loads all files again and runs DataNucleus enhancer... so it happens very often, could this be the reason?

Another thing is that it probably started after I implemented following solution ( How to use JDO persistence manager?) for working with Persistence Manager. I store the reference to PM in several places during the request but it all should get disposed after the request is finished right? And again, if it was caused by this, wouldn't the error occur after 3000 requests? (Which is way more request than during an hour of development).

Community
  • 1
  • 1
tobik
  • 7,098
  • 7
  • 41
  • 53
  • Commenting since you haven't gotten an answer (yet). "so it happens very often, could this be the reason" Yes, I think so. It is a known problem - thid-party stuff/libs "leaking" memory when re-deploying containers. Iirc it is usally a PermGen Error though.(Can't think of good search words at the moment) – esej Aug 04 '12 at 21:32
  • Known problem? So most likely this won't happen on the production server? Honestly this isn't the only problem with AppEngine SDK... for example every once in a while I get 404 error to all urls and again, simple restart fixes that. Or the whole server freezes and I have to kill it manually. So I guess I won't bother with that now, I'll wait until the app is in some usable state, then deploy it and if the error is still there, I'll deal with that. – tobik Aug 04 '12 at 21:52
  • The problem I'm refering too is only happening to me in dev env (I use a huge perm gen space to not get affected so often and still be able to redeploy without restart). In prod I/we always restart the app server @ releases. http://frankkieviet.blogspot.se/2006/10/how-to-fix-dreaded-permgen-space.html – esej Aug 04 '12 at 22:09
  • Thanks, this answer is good enough for me. Since the app really doesn't do anything, it can hardly contain a memory leak, so I suppose it's really caused by frequent redeployment, as in you case. – tobik Aug 04 '12 at 22:20
  • Otherwise try deploying the application-at-current-stage to appspot and try whether gets same error on the server. – vivek_jonam Aug 05 '12 at 04:05
  • At current stage the application is nothing more than a playground with some basic JDO stuff and experiments, I can hardly say to users to test it when there is nothing to test. As I mentioned in the question, I tried to simulate the traffic on the dev server using wget, but it led nowhere, the error didn't occur even after 3000 requests which is definitely more than during an hour of development. I suppose it wouldn't do anything on production server as well. At this point the best explanation is frequent redeployment and the other guy confirmed that. – tobik Aug 05 '12 at 07:29

1 Answers1

0

I don't want to leave this question unanswered, so this is extracted from the comments below the questions:

Yes, PermGen error could be caused by frequent redeployment during the development process. So the app doesn't necessary have to have a memory leak.

tobik
  • 7,098
  • 7
  • 41
  • 53