Details
Assignee
UnassignedUnassignedReporter
kamowkamowLabels
Bug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
kamowMarko BekhtaPriority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
kamow
kamowLabels
Bug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
kamow
Marko Bekhta
Priority
Created May 30, 2024 at 1:57 AM
Updated May 31, 2024 at 7:12 AM
During validation, the
processedPathsPerBean
always consumes more memory, regardless of whether there are actually valid constraints. In this case, hibernate occupies a large amount of memory. In the concurrent scenario, when the object size is large, OOM occurs. I think this is a bug, and some strategy should be taken to constrain the size ofprocessedPathsPerBean
, such as only validating if there is an actual constraint.According to the analysis, traversableResolver and failingConstraintViolations occupy a large amount of memory during the verification process, but they can be used.
addProperty("hibernate.validator.enable_traversable_resolver_result_cache", "false") and addProperty("hibernate.validator.fail_fast", "true") to prevent them from consuming memory. But there is no way to reduce the memory footprint of processedPathsPerBean.
This is the result of one of our hprof memory analyses.
The demo code that is causing the problem is this, and run with -Xmx5M