Yes, this will restart the JVM. Dynos need to make sure they can handle restarts gracefully. This means you probably need to utilize an external system for session state or something like Memcached to cache stuff.

I just did a blog post on how to transparently move session state to an external MongoDB system:
http://www.jamesward.com/2011/11/30/using-mongodb-for-a-java-web-apps-httpsession

Hope that helps.

-James


On 12/02/2011 08:41 PM, Zemian Deng wrote:
Hi James,

Thanks for replying. Will this "idle" process restart the JVM? The
reason I ask is that whenever this happens, I lost a in-memory map
content as if app has been restarted.

Also would you know what is this time span of inactivity before the
idle process kicks in?

Thanks,
-Z

On Dec 2, 6:31 pm, James Ward<[email protected]>  wrote:
With only one dyno, Heroku will idle it when it hasn't received any
requests for a while.  When a request comes in, Heroku will un-idle it
and that is probably why you are seeing some delay while the app is
being started back up.  One option is to scale to more than one dyno.

More details:http://devcenter.heroku.com/articles/dyno-idling

-James

On 12/01/2011 08:32 PM, Zemian Deng wrote:

Hello there,

I have sucessfully deployed a Java webapp into Heroku, and I am just
trying out the free default plan. But I have observed that it seems
like the JVM process would get restarted after a certain period
inactivity. The first hit of the webapp URL after this behavior takes
a while to load (about 10+ secs or so)

So this expected behavior for Java on Heroku?

Thanks,
Zemian Deng


--
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to