Hi guys,

We are having a very weird problem, where the process memory keeps rising, 
but both the pprof and valgrind report no memory leaks. But the RSS just 
keeps rising.The C part is in external so library

To be more exact, the pprof when the process becomes idle reports a few 
megabytes used and the Valgrind reports 88bytes lost(this are global 
objects) But the RSS for example is ~1G and virtual 4G+
I've run also run the app with the GODEBUG=madvdontneed=1,gctrace=1 but 
madvdontneed doesn't seem to help.

If I describe the MO of communicating with the library's API (all memory is 
allocated on the library side). 

for {
  * initialize the processor 
  * say to the library to create the blob of size x on it's side
  * convert the returned pointer to a fake slice (code below)
  * copy data to the fake slice
  * instruct processor to do it's thing (e.g make calculations/compress the 
data,...)
  * process the data on Go side (depending on the processor this either 
makes a copy of the data or creates a fake slice from it)
  * destroy the processor (this frees the memory on the library's side)
  * upload the data somewhere
}

func cVoidPtrToByteSlice(data unsafe.Pointer, size int, bytes *[]byte) {
    header := (*reflect.SliceHeader)(unsafe.Pointer(bytes))
    header.Data = uintptr(data)
    header.Len = size
    header.Cap = size
}

BR,
Miha

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/de3655e0-62b4-4f39-ac52-82483b9009fc%40googlegroups.com.

Reply via email to