-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: Reduced garbage on InsightsReport's serialization #110
Conversation
@ehsavoie too |
api/src/main/java/com/redhat/insights/http/InsightsFileWritingClient.java
Outdated
Show resolved
Hide resolved
Another thing that could be fixed in the original code is to address the double copy (from heap ByteBuffer to direct one) hidden in the file writes, hitting https://github.com/openjdk/jdk/blob/9f98136c3a00ca24d59ffefd58308603b58110c7/src/java.base/share/classes/sun/nio/ch/IOUtil.java#L94 which cause unwanted and unpleasant creation of pooled (ie a proper leak) direct Buffer which would impact on EAP off-heap/direct memory footprint, see https://github.com/openjdk/jdk/blob/33011ea19bb29e88ce18a138a8fa8b34f8c97407/src/java.base/share/classes/sun/nio/ch/Util.java#L77 which show that by default, such temporary direct buffers are (thread-local) cached without any limits, per buffer. In this regard, |
65d8435
to
f1d3230
Compare
@kittylyst I've send an additional (optional) commit to address the comment at #110 (comment)
|
Hi folks. Thanks for the detailed work on this PR. I am quite lost in all the comments and so forth, and as a result I'm not clear on the design intent here. Can we put a call in next week to discuss @franz1981 ? Also - can you link to the test cases that indicate the issue that we're trying to solve by this change? |
Yep, let me summarize the main points here:
We can go through these with some profiling data during the call plus the other topics that @ehsavoie want to talk about, thanks! |
3b1fe4b
to
430ead9
Compare
Nevermind the failure on the latest conventional commit checks, it's because the original PR didn't have a matching title (happened to me before) |
Superseded by #117 |
Got a couple of questions before proceeding (adding tests and/or other changes).
It appears that in the multi client case each client serialize the same report many times, but they have the option (for each one) to decorate it:
There is a way to safely assume it won't be changed (by decoration?) and just serialize it once?
I refer to this
insights-java-client/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java
Line 43 in 21aca0c
It would be nice to pass through the previously serialized report, during the iteration, if we an assume it to not be changed.