Add serializer-cache size limit to avoid Metaspace issues from caching Serializers
See original GitHub issueI know this is a topic that has been discussed before (#489 & #1905), but it has been a few years so I wanted to open the discussion again.
I see that there are changes coming in 3.0 to limit the size of the serializer cache to 4000 (#1994). Are there any other plans to allow tuning this size, adding a ‘super flush’, or letting the consumer provide the cache implementation (ex. with weak references)?
Our app servers have a lot of DelegatingClassLoaders
sticking around due to reflection methods being stored in the SerializerCache
(like _accessorMethod
in BeanPropertyWriter
) and it would be great if we had more control over the caching strategy so metaspace doesn’t grow unbounded.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Solving java.lang.OutOfMemoryError: Metaspace error
OutOfMemoryError: Metaspace indicates that the amount of native memory allocated for Java class metadata is exausted. Let's how this issue.
Read more >Java OutOfMemoryError Exceptions: Causes & Fixes [Tutorial]
OutOfMemoryError: Metaspace error is thrown. To mitigate the issue, you can increase the size of the Metaspace by adding the -XX: ...
Read more >Email patch
The Java Heap base address is the +# maximum limit for the native heap growth. ... sizes (-Xss) +# Set larger code cache...
Read more >Troubleshooting Microservice's OutOfMemoryError: Metaspace
It indicates Garbage collection events aren't able free up Metaspace. It clearly indicates there is a memory leak in the Metaspace region. Root ......
Read more >47.113.125.96:3000/baigg91zb/tycx_gps/commit/bffc3...
+# Native memory allocation (malloc) failed to allocate 1510096 bytes for ... the process size limit was hit +# Possible solutions: +# Reduce...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, Jackson 1.x has not been modified in literally years and I have no way to actually publish any of jars even if I did change the copy Github has. So issues it has will remain issues unless someone forks the build (or implements proper Maven build).
As to 2.x, sure, PRs welcome! I do not necessarily have time to make changes but can usually help others get PRs merged.
@cjimenez1 The codehaus implementation is Jackson 1.x and hasn’t seen a release for 8 years. You should upgrade to Jackson 2.