karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.27k stars 118 forks source link

memory leak #74

Closed hktalent closed 1 year ago

hktalent commented 1 year ago

github.com/karlseguin/ccache

image
karlseguin commented 1 year ago

I don't immediately know. Any context? Was Stop called on the cache? What type of objects are being stored in it? Anything else?

hktalent commented 1 year ago

@karlseguin thanks for you

Using multi-instance and multi-threading using nuclei in encapsulation https://github.com/projectdiscovery/nuclei/issues/2357 when, through

found when comparing

karlseguin commented 1 year ago

Thanks, that helps, but I'm not sure it's a bug.

ccache.New starts a goroutine. To stop it, Stop() needs to be called. If caches are created and fall out of scope without calling Stop() the goroutine will leak.