Here is minimal example: https://gist.github.com/mkevac/2006f7fa8be38fb1ee00
I have channel that I sent to and receive from. One of the
senders\receivers uses select. And seems that each select creates a little
bit of a garbage.
marko@fedora-server:~/goprojects/src/badoo/heaptest $ ./heaptest
2014/10/17 20:59:31 profile: memory profiling enabled,
/tmp/profile883713528/mem.pprof
^C2014/10/17 20:59:40 profile: caught interrupt, stopping profiles
marko@fedora-server:~/goprojects/src/badoo/heaptest $ go tool pprof
--alloc_objects ./heaptest /tmp/profile883713528/mem.pprof
Adjusting heap profiles for 1-in-4096 sampling rate
Welcome to pprof! For help, type 'help'.
(pprof) top
Total: 29161720 objects
22648298 77.7% 77.7% 22648298 77.7% newselect
6513152 22.3% 100.0% 6513152 22.3% main.main
256 0.0% 100.0% 256 0.0% runtime.mallocinit
14 0.0% 100.0% 14 0.0% allocg
0 0.0% 100.0% 270 0.0% _rt0_go
0 0.0% 100.0% 22648298 77.7% main.loop
0 0.0% 100.0% 14 0.0% mcommoninit
(pprof)
If I use channel of integers instead of channel of pointers to integers,
than this garbage is not being created.
Can someone explain what is happening here?
Marko.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.