Macaulay2 / Macaulay2/M2

Memory leak in creating a sequence

Open
#2,562 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I believe the following line has a memory leak:
```m2
f = () -> (scan(0..10^7, i -> ());)
```
At least it seems like after several times running `f()`, M2 grinds to a halt.

I should say, even running:
```m2
a = (1..10^7);
clearAll()
collectGarbage()
```
several times seems to do the same, so maybe this is something else? (I'm assuming `clearAll` and `collectGarbage` do _something_, right?)

cc: @jkyang92

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.

Research direction

Reproduce the two examples in M2, including repeated calls to f(), clearAll(), and collectGarbage(). Start by examining the behavior of scan, sequence creation, clearAll, and collectGarbage; done means identifying the cause of the slowdown and verifying that repeated runs no longer make M2 grind to a halt.

Written by the indexing model from the issue text.

Assessment

Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.