Memory management in Multi and Uni #1542
Unanswered
IshlahulHanif
asked this question in
Q&A
Replies: 1 comment 4 replies
-
A couple of observations.
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm pretty new to mutiny and reactive programming, so pardon if the answer is obvious
I have an issue where my instance consistently get
java.lang.OutOfMemoryError: Java heap space
error due to processing a high count of data from database. I mitigate this by replacing theUni
withVoid
at the end of Uni, assuming it will allow previously created list will be garbage collected if I do so.This is roughly my code:
as for the functions, roughly they are like this:
I'm using non-reactive hibernate due to need multiple data source (reactive does not support that yet) and the project is too far to re-write the project in imperative way. I'm also not sure if using
Multi
is the correct approach here, instead ofUni<Collection>
because thegetAllMatchingItem
is already in memory anywayBeta Was this translation helpful? Give feedback.
All reactions