Hystrix icon indicating copy to clipboard operation
Hystrix copied to clipboard

The DynamicIntegerProperty will case heap overflow and memeory leaks

Open evvil opened this issue 8 years ago • 5 comments

@benjchristensen @spencergibb Hi, when i use the hystrix to dynamically update the config of the hysitrx, it cause heap overflow. I use jmap to dump the heap, and use MAT to analyze the heap.log, I found there were lots of big objects which causes memory leaks.

image

As we can see, it was caused by adding the callback() continuously. image

After analyzing, I found it has differences from DynamicIntegerProperty and DynamicIntProperty. We can find

1. archaius-core-0.6.0-sources.jar!\com\netflix\config\PropertyWrapper.java

image

2. com.netflix.hystrix.strategy.properties.HystrixPropertiesChainedArchaiusProperty.DynamicIntegerProperty

image

And if it can't find the cache in the private static final IdentityHashMap<Class<? extends PropertyWrapper>, Object> SUBCLASSES_WITH_NO_CALLBACK , it will add the callback,

So, does it spell wrong to cause the memory leaks?

evvil avatar Dec 14 '17 09:12 evvil

Still have this issue? You'd better describe more details about the environment and steps to produce this issue. Like which version Hystrix did you use.

yanglifan avatar Feb 11 '18 02:02 yanglifan

sorry, i didn't notice it during Srping Festival @yanglifan I think this problem sitll has, becaues the inappropriate use of our behaviors, we rebuilded lots of hystrix's thread pool during using for hot reloading. And the hystrix use dynamic property to store these properties. When we rebuild these tread pools, we didn't remove these properties and caused these problems.

evvil avatar Feb 22 '18 08:02 evvil

Is there any new version of this library coming up with this fix?

ashish4710 avatar Jul 25 '19 08:07 ashish4710

I am also facing similar memory consumption issue with Hystrix Dynamic properties. @evvil Could you tell more about how you resolved the issue. "When we rebuild these tread pools, we didn't remove these properties and caused these problems." Which properties you are taking about and how you removed them ?

vipinjnair avatar Jul 15 '21 08:07 vipinjnair

we download the source, and change the code in the source, and push jar to our company's maven repo.

vipinjnair @.***> 于2021年7月15日周四 16:07写道:

I am also facing similar memory consumption issue with Hystrix Dynamic properties. @evvil https://github.com/evvil Could you tell more about how you resolved the issue. "When we rebuild these tread pools, we didn't remove these properties and caused these problems." Which properties you are taking about and how you removed them ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Netflix/Hystrix/issues/1735#issuecomment-880488078, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5VDPEXIR33YBFHUVHTCCDTX2JK5ANCNFSM4EIHGULA .

evvil avatar Dec 21 '21 07:12 evvil