Ticket #591 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Strings never freed when retrieving text from virtual buffers

Reported by: jteh Owned by: mdcurran
Priority: major Milestone: 2010.1
Component: Browse mode Version:
Keywords: memoryLeak Cc:
Operating system: Blocked by:
Blocking:

Description

Str:

  1. Open http://www.nvda-project.org/ in Firefox and move focus inside the buffer.
  2. Press NVDA+ctrl+z to activate the Python console.
  3. Type:
    ti = focus.virtualBuffer.makeTextInfo("all")
    for i in xrange(20000): t = ti.text
    

Actual: Massive memory leak (NVDA shoots up to about 300 mb here).
Expected: Uh... no memory leak.
Note that closing the browser doesn't clean this up.

This happens because VBuf_getTextInRange allocates a string on the server side which is then marshalled to the client but never freed. We figured that ctypes was freeing the string when it was garbage collected by Python (which is actually incorrect, since ctypes didn't allocate it), but it seems that ctypes (correctly) doesn't do this after all.

Change History

comment:1 Changed 2 years ago by jteh

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in changeset:main,3397 with some cleanup in changeset:main,3398.

Note: See TracTickets for help on using tickets.