Opened 3 years ago

Closed 3 years ago

#24745 closed defect (fixed)

leaking in the symbolic ring

Reported by: vdelecroix Owned by:
Priority: blocker Milestone: sage-8.2
Component: memleak Keywords:
Cc: rws Merged in:
Authors: Ralf Stephan Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: a42d589 (Commits, GitHub, GitLab) Commit: a42d5893a26bab529152311478a8c081e1612f49
Dependencies: #24668 Stopgaps:

Status badges

Description

The following operation creates a leak

pi * I * RR.one()

This can be tested with

import gc

def num_complex():
    gc.collect()
    return sum(1 for t in gc.get_objects() if type(t) is sage.rings.complex_number.ComplexNumber)

for _ in range(10):
    print num_complex()
    for _ in range(10):
        a = pi * I * RR.one()

Original report on https://groups.google.com/forum/#!topic/sage-devel/pRXccDmXkIE|sage-devel.

Change History (7)

comment:1 Changed 3 years ago by rws

Thanks for the excellent diagnostics. I will commit a Pynac patch which depends on #24668 (0.7.16). There was a superfluous Py_INCREF in the in-place multiplication code.

comment:2 Changed 3 years ago by rws

  • Branch set to u/rws/leaking_in_the_symbolic_ring

comment:3 Changed 3 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to a42d5893a26bab529152311478a8c081e1612f49
  • Status changed from new to needs_review

Note you need beta6 (or a copy of pynac-0.7.16 in upstream/) to test this.


New commits:

f5b3de424668: version/chzksum
67f9ddc24668: doctest fixes
256849224668: fix doctest
9b2e16cMerge branch 't/24668/upgrade_to_pynac_0_7_16' into t/24745/leaking_in_the_symbolic_ring
a42d58924745: pynac patch: fix memleaks in in-place PyObject numerics

comment:4 Changed 3 years ago by jdemeyer

  • Dependencies set to #24668

comment:5 Changed 3 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer

comment:6 Changed 3 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:7 Changed 3 years ago by vbraun

  • Branch changed from u/rws/leaking_in_the_symbolic_ring to a42d5893a26bab529152311478a8c081e1612f49
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.