Memory leak in BasicFormatterImpl

Description

When It is json, there are some memory leak.

These are the results of the modified code and the existing code when tested locally.

This problem doesn't normally occur, but it makes a difference if you are performing json. This occurs when tokenizing json and formatting it while passing the switch statement within the perform method. Therefore, it seems better to change this code to StringBuilder as shown below.

 

Sample query is below

In the case above, there is no problem elsewhere, but the problem occurs at the point where JSON data is encountered after VALUES. From this point on, a String is created in the above code for all tokenized JSON data, creating a memory leak. This means that the larger the JSON, the more leaks it will create.

 

https://github.com/hibernate/hibernate-orm/pull/9545

Attachments

1

Activity

Show:

ElasticFinger January 6, 2025 at 8:16 AM

Could you help to check this?

Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Unassigned

Reporter

Components

Priority

Created January 3, 2025 at 6:42 AM
Updated January 6, 2025 at 8:16 AM
Loading...