Skip to content

Weak references in Polynomial Ring cache #5970

@simon-king-jena

Description

@simon-king-jena

At http://groups.google.com/group/sage-support/browse_thread/thread/ef01dae47c835137 a memory leak was reported.

Reason for the leak: Many different polynomial rings are created, but used only once. But since we want to have unique parents, they are all cached and thus prevented from deletion.

As Robert pointed out, using weak references enables us to both have unique parents and garbage collection.

With the patch, that should at least apply to sage 3.4.1.rc3, one can do

sage: for p in primes(2,1000000):
....:     R.<x,y,z> = GF(p)[]

without running into memory problems.

See instead #715.

CC: @jpflori @zimmermann6 @vbraun

Component: commutative algebra

Keywords: polynomial ring cache weak reference

Reviewer: Simon King

Issue created by migration from https://trac.sagemath.org/ticket/5970

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions