Closed Bug 391776 Opened 17 years ago Closed 17 years ago

PKIX uses arenas without any freelists

Categories

(NSS :: Libraries, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 391244

People

(Reporter: dbaron, Assigned: alvolkov.bgs)

References

(Depends on 1 open bug)

Details

(Keywords: memory-leak, Whiteboard: PKIX)

This bug is filed based on the NSS_3_12_ALPHA1B tag, which is what is currently used by the trunk of Firefox, etc.

PKIX seems to allocate significant numbers of objects out of an arena (created with a PORT_NewArena call in PKIX_PL_NssContext_Create) for the lifetime of NSS.  When these objects are destroyed, they are not placed on any freelist for recycling; instead the arena pools just grow as more objects are created and destroyed.  PKIX_PL_Realloc and PKIX_PL_Free do nothing with the freed memory when context != NULL && context->arena != NULL.  This means that the memory used grows over the lifetime of the application, even though the leak won't show up with many memory leak tools if is all freed in the PORT_FreeArena call in PKIX_PL_NssContext_Destroy during shutdown.
Flags: blocking1.9?
This seems like a duplicate of bug 391775.  They're the same issue, I think.
And both bugs seem to be dupliates of bug 391244.

David, did you actually experience these leaks? 
or did you merely find them by code inspection?  
I ask because, except for the PKIX initialization code (and shutdown code), 
all of libPKIX should be unused in FireFox at this time. 
Assignee: nobody → alexei.volkov.bugs
OS: Windows XP → All
Hardware: PC → All
Whiteboard: PKIX
Target Milestone: --- → 3.12
Version: 3.12 → trunk
I found this by code inspection after observing bug 391775.
This is a duplicate of 391244.  
I think the solution to this bug, which uses arenapools whose scope matches
the scope of the objects and/or functions being performed, will not (by itself)
resolve bug 391775, which is why I'm not marking it as a duplicate (although
they are clearly related).
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.