Perhaps this is obvious, but suddenly heavy garbage *collection* operations
suggest heavy garbage *creation* operations; that new code or structure is
allocating and discarding more than the old. You've gone from single to
multiple caches, so my thoughts go to: is data cached redundantly? (is the
n-cache version n-times as much GC or memory), are cached elements
migrating without memory reuse?, is the n-way concurrency implied causing
simultaneous caching as a temporal artifact? These seem like the right
kinds of questions to consider. Robert Engels already shared the
fundamental insight that GC cost is a reflection of your application's
"spending habits" and not generally something to control in the collector
itself.

On Tue, Jun 4, 2019 at 5:55 AM Joseph Wang <wzfbr...@gmail.com> wrote:

> Hello everyone
>
> I just have a question about my golang code debugging. It's not specific
> code question. But I never met this issue before.
>
> The problem is like this. I replaced our back-end system's cache from
> single node cache to groupcache that is a kind mem cache. Then I met high
> memory usage issue at beginning. I use pprof and online resource then I set
> up GC rate(10%) to reduce memory usage down to normal. But then this will
> cause high CPU usage, because heavy GC operations. I use pprof to get the
> hot spot is runtime.ScanObject() this function, which is out of scope of my
> code base.
>
> So I don't know if anyone can give me some suggestions about how to fix
> this kind issue. I know the issue should come from my code base. But I
> don't know how to find out the issue and fix it ASAP.
>
> Best,
>
> Joseph
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/5c977af4-074e-4eaf-85c2-2a284595b572%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/5c977af4-074e-4eaf-85c2-2a284595b572%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

*Michael T. jonesmichael.jo...@gmail.com <michael.jo...@gmail.com>*

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CALoEmQzCpxB-f7Xds-SatQApYTXAem76JvstN3YT%3DYZdejgHyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to