You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/07 03:46:06 UTC

[GitHub] [apisix] tzssangglass commented on issue #8461: help request: using ext-plugins on requiredBody true, memory leak occurs

tzssangglass commented on issue #8461:
URL: https://github.com/apache/apisix/issues/8461#issuecomment-1340332465

   ref: https://github.com/google/flatbuffers/blob/master/lua/flatbuffers/builder.lua#L64-L79
   ```lua
   -- Clears the builder and resets the state. It does not actually clear the backing binary array, it just reuses it as
   -- needed. This is a performant way to use the builder for multiple constructions without the overhead of multiple
   -- builder allocations.
   function mt:Clear()
       self.finished = false
       self.nested = false
       self.minalign = 1
       self.currentVTable = nil
       self.objectEnd = nil
       self.head = self.bytes.size -- place the head at the end of the binary array
   
   
       -- clear vtables instead of making a new table
       local vtable = self.vtables
       local vtableCount = #vtable
       for i=1,vtableCount do vtable[i] = nil end
   end
   ```
   
   what you say `doesn't release memory.` means `It does not actually clear the backing binary array`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org