-
Notifications
You must be signed in to change notification settings - Fork 706
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
Spring Boot 2.6.14 + Spring Cloud Context 3.1.5 fullgc #1204
Comments
Hello, @Johnson-Jia . It seems the cache of Not sure whether a bug it is, but you could use |
Hello, @Johnson-Jia . In my experience, although each execution of This is rarely the case as a dynamic configuration in my experience, so you have more detailed GC logs or heap analysis graphs to give us more helpful information? |
Thank you. How to enable caching instead of generating a copy of propertyNames every time you use getProperty. Use scenarios are as follows: Ten thousand records were queried from the database, and the relevant business logic was executed circularly. The 'getProperty' method was called in the loop, thus a large number of 'propertyNames' configuration objects that could not be recycled were found in the memory snapshot. |
你好,@jizhuozhi 场景: |
Hello, @Johnson-Jia . This is neither your problem nor spring-cloud's problem. Cache-related logic is provided by spring-boot. According to the content communicated with spring-boot members (spring-projects/spring-boot#34172 (comment)), configuration in the following way may solve your problem ConfigurationPropertyCaching.get(environment).setTimeToLive(timeToLive); |
Thanks @jizhuozhi |
Spring Boot 2.6.14
Nacos 2.1.1
Spring Cloud Context 3.1.5
Use Environment#getProperty to get the configuration center object. Generates a large number of LinkedHashSet objects. Cause the jvm to be full gc.
The code in BootstrapPropertySource is as follows:
The Environment#getProperty method is used inside the for loop.
The text was updated successfully, but these errors were encountered: