Macaulay2 / Macaulay2/M2

memory leak

Open
#488 3 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Engine
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

This code

```
engineMemory = value Core#"private dictionary"#"engineMemory"
needsPackage "RandomCanonicalCurves"
ps = () -> run ( "ps u " | toString processID () )
leak = c -> (
setRandomSeed "37862873";
g := 9;
p := 12347;
numEx := 40;
T := ZZ/p[t_0..t_(g-1)];
for i from 1 to 100 do (
IC := (random canonicalCurve)(g,T);
minimalBetti IC;
-- registerFinalizer (IC.cache.quotient,"--");
if c then IC.cache.quotient = null;
<< "." << flush;);
collectGarbage();
print engineMemory();
)
ps()
leak true
ps()
leak false
ps()
```

runnning under
https://github.com/mikestillman/M2/tree/newres
produces this totally perplexing result:

```
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
dan 75775 0.0 0.5 2917676 85244 s002 S+ 10:39AM 9:50.42 /Users/dan/src/M2/M2-Macaula
....................................................................................................size of each slabs = 2040
total engine space allocated = 0k
stash k total k in use size nalloc inuse highwater freed
Finalizations of new resolutions:
# of res objects constructed/deconstructed=(100,100) #left = 0
# of res objects constructed/deconstructed=(100,100) #left = 0

USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
dan 75775 102.8 0.6 2932208 101080 s002 S+ 10:39AM 10:59.57 /Users/dan/src/M2/M2-Macaula
....................................................................................................size of each slabs = 2040
total engine space allocated = 0k
stash k total k in use size nalloc inuse highwater freed
Finalizations of new resolutions:
# of res objects constructed/deconstructed=(200,180) #left = 20
# of res objects constructed/deconstructed=(200,180) #left = 20

USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
dan 75775 140.4 2.0 3177916 331080 s002 S+ 10:39AM 12:14.92 /Users/dan/src/M2/M2-Macaula
```

Solving it would improve memory performance a lot.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.