Skip to content
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

Possible memory issue while serializing dates? #51

Closed
neilprosser opened this issue Jan 14, 2016 · 2 comments
Closed

Possible memory issue while serializing dates? #51

neilprosser opened this issue Jan 14, 2016 · 2 comments

Comments

@neilprosser
Copy link

I'm having problems with a memory issue while using Logstash which I've tracked down to a large number of com.fasterxml.jackson.databind.modules.SimpleSerializers instances hanging around in memory.

I've grabbed object allocation reports and it looks like JrJackson is creating these objects in https://github.com/guyboertje/jrjackson/blob/master/src/main/java/com/jrjackson/RubyJacksonModule.java#L56 which has been called from https://github.com/guyboertje/jrjackson/blob/master/src/main/java/com/jrjackson/JrJacksonBase.java#L72. I've put the allocation call tree in a gist (https://gist.github.com/neilprosser/3298ada15ea5637a01bf) (apologies for the size) so you can see where the calls are coming from (from what I can see it's the JSON serialization for the Elasticsearch output and Redis output).

Looking at the code in JrJacksonBase.java (and assuming I don't have a custom date format, since I haven't explicitly set one anywhere, I'm just using Logstash but no date format mentioned in config or environment variables), does the code need to create a new provider every time if we're using the marker instance? Couldn't it cache that provider and use it if we're going to use RDF?

Hopefully you don't mind me creating the issue here. I figured since it's JSON serialization and it's come from two places it would be worth starting here and I can close this issue and shift it somewhere else if we find it shouldn't be here.

I've still got a broken instance running with a profiling agent available if you need more information. The symptoms I see are base memory usage (after old generation garbage collection) gradually increasing until Logstash spends all its time in garbage collection.

@neilprosser neilprosser changed the title Possible memory leak while serializing dates? Possible memory issue while serializing dates? Jan 14, 2016
@neilprosser
Copy link
Author

Sorry, I amended the issue title because I don't think this is a leak. It looks like there are references to the classes created and they would get garbage collected but they're never not referenced by anything.

@guyboertje
Copy link
Owner

Thanks for the very detailed report. I will get on it shortly.

guyboertje added a commit that referenced this issue Apr 11, 2016
post jar dependencies

final update for 0.3.9

add support for date

Fixes #47
Fixes #50
Fixes #51

Punctuation.

Fixes #47
Fixes #50
Fixes #51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants