-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory leak when running 2 atmosphere instances in one VM #43
Comments
Salut, I need information on (2) things. The first is why RC2 is failling (I'm about to release it today). The message you are seeing just help when a suspended connection gets it's associated Broadcaster destroyed. In that case the suspended connection is still alive and if a broadcast occurs, without that property set the message will be lost. So what's the exact issue you are seeing? For (2), anywhere I can download it will be fine...but the number of Broadcaster is for sure the issue...but are you resuming connection? It's one broadcaster per connection here (scope == request) so you may just hit the machine limits. Note that Jetty isn't cleaning client disconnection so that may also be an issue (you need to use the maxInnactive's property for reclaiming dead connection. I will delay the release 24 hours as I want to make sure everything is OK first. Thanks! -- Jeanfrancois |
heres my stacktrace with 0.8.0-RC2 11:46:45.198 [Atmosphere-AsyncWrite-0] WARN o.a.cpr.AtmosphereResourceImpl - Broadcaster http://localhost:9880/requests/12114 has been destroyed and cannot be re-used. Recreating a new one with the same name. You can turn off that mechanism by adding, in web.xml, org.atmosphere.cpr.recoverFromDestroyedBroadcaster set to false |
ad ".but are you resuming connection?". shoudln't the @Suspend-Attribute resumeOnBroadcast = true resume the connection? the client shouldn't disconnect the requests-timeout is set to infinity. i will try to provide a code example and the heapdump this evening (8-10 hours from now). |
OK I will try to reproduce that issue locally. Thanks for sharing!! |
i wrote a testcase https://github.com/cproinger/atmosphere/tree/master/samples/jetty-jersey-rest for 0.7.2: the heap-dump is in the root of this project for 0.8.0-RC2: 2011-10-24 22:28:19.021:WARN:oejs.HttpConnection:header full: java.lang.NullPointerException |
I cannot help for 0.7.2 as I'm trying to release 0.8 RC2. Are you using the latest SNAPSHOT? Do you think you can grab a SNAPSHOT? I can also reproduce the header NPE but that shoudn't hangs the process. Thanks for the help! |
The NPE seems to be from Jetty https://gist.github.com/1310124 will add a workaround. |
forked your repository this morning (10 hours ago), the test-case should use that version |
Ok the fix went in after. Sorry can you try with the latest? |
Test set: TestSuiteTests run: 71, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 389.04 sec <<< FAILURE! |
Ya, I need to fix the test. That test will pass if you run it standalone. BTW I've released 0.8.0-RC2. Let's see if that help. Anyway I will make sure this issue is fixed before making the final release. Thanks! |
i built RC2 again skipping the tests and ran my testcase again with this version. the tests got stuck (0% CPU, no requets processed) again at ~12000 requests. so i looked at the threaddump to see if there were threads blocked or something. the funny thing was, after some time (i forgot to kill the process) requests got processed again and after some time it got stuck again, and so on and so on with ~4 minute pauses with no CPU Activity, in this time memory got allocated and garbage collected though. |
Salut...well I think I will need a test case from you and you you stress it. I apologize I fail to see what can cause such issue with a sample I've written. Thanks for your patience |
OK, I think the fix went in this morning (I was able to reproduce an OOM with SCOPE == REQUEST) and without any BroadcasterLifeCycle policy. In both branches. Closing, re-open if you still see it. |
hi jeanfrancois.
i use atmosphere 0.7.2 (i tried 0.8.0-RC2 but with this version something goes wrong, but i couldn't quite make out what exactly "The current Broadcaster has been destroyed and cannot be re-used. Recreating a new one with the same name. You can turn off that mechanism by adding, in web.xml, org.atmosphere.cpr.recoverFromDestroyedBroadcaster set to false" => turned it off, doesn't work either), jersey 1.9.1 and jetty 7.5.1.v20110908 (Jetty7CometSupport).
heres my scenario. i'm performing benchmark tests with 2 programmatically configured and bootstrapped jetty instances with jersey and atmosphere. (every instance-specific objects i bind in the servletContext) one instance sequentially calls the other using AsyncHTTPClient invoking a atmosphere annotaded method like this.
now my tests make ~200.000 requests like this sequentially. after some time theres no progess anymore. The GC is running all the time but cannot free any memory (i guess it's not throwing a OOM because my client stops requesting too at that time). so i made a heapdump and i saw that there are many JerseyBroadcasters still in Memory (20.091). (when i set Xmx to a high enough level my test completes but still the memory consumption raises the whole time when someone would expect it to be pretty constant since it's the same request over and over again)
i learned the hard way that atmosphere doesn't destroy those by default but i configured the "org.atmosphere.cpr.broadcasterLifeCyclePolicy" to be EMPTY_DESTROY (before that i ran out of memory much ealier). the heapdump now tells me (i analyzed it with the eclipse MemoryAnalyzerTool. i don't do that often so i may misinterpret this) that those Broadcasters are still in the DefaultBroadcasterFactory's ConcurrentHashMap (store).
i stored the heapdump. zipped it's 30 MB. if you could take a look at it i would really appreciate it. how can i make it available to you? should i create a git-repo for it or do you know an easier way?
greets christian
The text was updated successfully, but these errors were encountered: