Re: [go-nuts] Re: Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
you very much, Jan! On Wednesday, May 3, 2017 at 7:01:34 PM UTC+2, Jan Mercl wrote: > > On Wed, May 3, 2017 at 6:50 PM Piotr Narewski <piot...@gmail.com > > wrote: > > > Perhaps that is the reason; when I need 515 bytes, it actually allocates > 1024 > > This

Re: [go-nuts] Re: Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
Yes. Perhaps that is the reason; when I need 515 bytes, it actually allocates 1024 This might be when I'm loosing the mem. On Wednesday, May 3, 2017 at 6:47:53 PM UTC+2, Jan Mercl wrote: > > On Wed, May 3, 2017 at 6:28 PM Piotr Narewski <piot...@gmail.com > > wrote: > > &g

Re: [go-nuts] Re: Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
No sorry - I think I did not do it right. I am supposed to allocate the slice with "slice.Bytes.Get(515).(*[]byte)" not "make([]byte, 515)" In which case I still don't know why it's eating up my mem... :) On Wednesday, May 3, 2017 at 6:28:20 PM UTC+2, Piotr Narewski wrote:

Re: [go-nuts] Re: Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
, Jan Mercl wrote: > > On Wed, May 3, 2017 at 4:24 PM Piotr Narewski <piot...@gmail.com > > wrote: > > > I've just tried it and unfortunately it doesn't seem to be better than > the traditional approach. > > > > With the pool in place, it still user too much m

[go-nuts] Re: Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
3, 2017 at 2:35:43 AM UTC+8, Piotr Narewski wrote: >> >> My app uses large amounts of memory; it actively allocates and frees lots >> of slices. >> I'm talking about gigabytes here. >> >> With the default GOGC=100 setting, it needs twice more memory. >> &

Re: [go-nuts] Is there a way to fee a memory object on demand?

2017-05-03 Thread Piotr Narewski
Thanks. Sorry, but I don't quite get this usage example. Wouldn't it require me to only use slices of a fixed size? On Tuesday, May 2, 2017 at 9:30:45 PM UTC+2, Jan Mercl wrote: > > On Tue, May 2, 2017 at 8:35 PM Piotr Narewski <piot...@gmail.com > > wrote: > > > Does

[go-nuts] Is there a way to fee a memory object on demand?

2017-05-02 Thread Piotr Narewski
My app uses large amounts of memory; it actively allocates and frees lots of slices. I'm talking about gigabytes here. With the default GOGC=100 setting, it needs twice more memory. When I decrease GOGC to a lower value, it affects performance pretty badly. So far the best solution I have