tinycodinglm / lang /lang-0018.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 15)
b27bfb3 verified
|
Raw History Blame Contribute Delete
752 Bytes
opencode trace
System You are an expert software engineer.

You are an expert software engineer.

User

How does Go's garbage collector work?

Assistant

Concurrent tri-color mark-sweep. Write barrier during concurrent marking.

Phases: Mark setup (STW), Concurrent marking (scan stacks/globals/heap), Mark termination (STW), Concurrent sweep.

Pacing: GC when heap grows by GOGC% (default 100%). GOMEMLIMIT for soft memory limit.

Tips: avoid hot-path allocations, sync.Pool for temporaries, pre-allocate slices, string builders.