Opened 14 years ago
Closed 14 years ago
#4241 closed defect (fixed)
[with patch; positive review] magma -- memory is never freed in the interface when MagmaElement's are deleted
Reported by: | was | Owned by: | was |
---|---|---|---|
Priority: | major | Milestone: | sage-3.2 |
Component: | interfaces | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Observe:
sage: a = magma('10000') sage: a.name() '_sage_[1]' sage: del a sage: magma.eval('_sage_[1]') '10000'
Whenever anybody ever creates a MagmaElement? via the Magma interface, it doesn't get deleted. This is because possible (1) the clear method in magma.py is commented out, and/or (2) the _available_var list that gets appended to in (1) isn't actually used by magma.py, so e.g., _sage_[1] in the example above never gets re-used.
Attachments (1)
Change History (7)
comment:1 Changed 14 years ago by
Status: | new → assigned |
---|
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Without patch:
sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 42917912 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 94192176 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 121287216
With patch:
sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 40817200 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 41820720 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 41820720 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 41820720 sage: a = [magma('3^100000') for _ in range(1000)]; del a;magma.GetMemoryUsage() 41820720
}}}
Changed 14 years ago by
Attachment: | sage-4241.patch added |
---|
comment:4 Changed 14 years ago by
Summary: | magma -- memory is never freed in the interface when MagmaElement's are deleted → [with patch; needs review] magma -- memory is never freed in the interface when MagmaElement's are deleted |
---|
comment:5 Changed 14 years ago by
Summary: | [with patch; needs review] magma -- memory is never freed in the interface when MagmaElement's are deleted → [with patch; positive review] magma -- memory is never freed in the interface when MagmaElement's are deleted |
---|
Patch looks good to me. There is a spelling error in the new docstring: "clearlying" _ i will fix it in the patch I will apply.
Cheers,
Michael
comment:6 Changed 14 years ago by
Milestone: | sage-3.2.1 → sage-3.2 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Merged in Sage 3.2.alpha1
Note: See
TracTickets for help on using
tickets.
Here's a vivid illustration of the memory leakage, which of course we know is there by reading the code: