Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak with nested Exceptions #22398

Closed
inv2004 opened this issue Aug 7, 2023 · 2 comments
Closed

memory leak with nested Exceptions #22398

inv2004 opened this issue Aug 7, 2023 · 2 comments
Assignees

Comments

@inv2004
Copy link
Contributor

inv2004 commented Aug 7, 2023

Description

while true:
  try:
    try:
      raise newException(ValueError, "")
    except CatchableError:
      raise newException(ValueError, "") # or raise getCurrentException(), just raise works ok
  except ValueError:
    discard
  echo getOccupiedMem()

--mm:arc or --mm:refc - does not matter

Nim Version

  • 2.0.0
  • 1.6.14

Current Output

increased memory usage (visible in top too)

Expected Output

constant memory usage

Possible Solution

No response

Additional Information

It was suggested to check with -d:useMalloc. It made the getOccupiedMem to 0 (like it is ok), but top still shows growing rss

@ringabout
Copy link
Member

ringabout commented Aug 18, 2023

The leak is caused a chain formed by the exceptions, which might indict that some logics related to popCurrentException are wrong. I'm gonna break the chain somehow.

@ringabout
Copy link
Member

Related to #18070

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants