Re: [go-nuts] why is my program retaining memory when len([]byte)>16384 ?

2016-07-04 Thread mhhcbon
Hi, thanks for help! But the problem might just be that you're writing many more bytes to > your encoder than you're reading from the file. > Did you mean i should write it so ? Write(srcBuf[0:lenRead]) nrRead, err := src.Read(bufRead); // read from file if err!= nil { break

Re: [go-nuts] why is my program retaining memory when len([]byte)>16384 ?

2016-07-03 Thread Jesse McNelis
On Mon, Jul 4, 2016 at 3:35 AM, mhhcbon wrote: > Hi, > > I have this program which reads file, flate encode then flate decode the > data. > > I noticed that when i used different size for the slice of []byte to read > data, the program will retain memory when the size

Re: [go-nuts] why is my program retaining memory when len([]byte)>16384 ?

2016-07-03 Thread mhhcbon
Sorry for my explanations. I wanted to mean that when i use a len([]byte) <=16384 the program can read lots of megabytes and remains at a stable state of memory usage, 5 mb. When i use higher values, the memory grows and keep growing. by higher value i mean anything > 16384 The slice is

Re: [go-nuts] why is my program retaining memory when len([]byte)>16384 ?

2016-07-03 Thread Janne Snabb
On 2016-07-03 20:35, mhhcbon wrote: > r :=buf.Bytes()// read from encoder > buf.Truncate(0) I did not understand your explanation of the problem, but surely there is a bug in the code quoted above. Read bytes.Buffer Bytes() function documentation: func (b *Buffer) Bytes() []byte Bytes

[go-nuts] why is my program retaining memory when len([]byte)>16384 ?

2016-07-03 Thread mhhcbon
Hi, I have this program which reads file, flate encode then flate decode the data. I noticed that when i used different size for the slice of []byte to read data, the program will retain memory when the size is > 16384. When its lower than this value everything is fine, but 16385 breaks. I