RSS Amplifier

Scramblings · Mar 24, 2020

Memory analysis in Go

0
Sign in to vote or save

pankajpipada.com

Mar 24, 2020 | Reading Time: 1 min

Generic references and points to consider when doing a memory analysis with go programming language.

  • Do pprof memory profiling.

  • Go returns memory to OS gradually. Typical time is ~5 minutes. If immediate return is needed, we could use FreeOSMemory. General recommendation is that if this is needed, manage memory alternatively.

  • Alternative for frequent allocated and reused objects is sync.Pool usage. This is tricky and have to be careful when doing this. Sample usage can be found in blog.

  • Excellant High performance go tips are avilable at this post. This talks about memory and GC too.

  • Garbage collection behaviour is well explianed at: Ardan labs Post 1, Post 2 and Post 3. Also there is this keynote explaining the evolution of Go’s garbage collector.

Read the original on pankajpipada.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.