8000 Memory leaks when using the mpfr type for arithmetic · Issue #569 · aleaxit/gmpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Memory leaks when using the mpfr type for arithmetic #569
Open
@ekera

Description

@ekera

I am seeing memory leaks when using the mpfr type as provided by gmpy2, both under MacOS X and Ubuntu. This issue currently prevents me from using gmpy2 in practice for some use cases in my research.

For example, the below snippet causes memory leaks (at a fairly alarming rate):

from gmpy2 import mpfr

while True:
  x = mpfr("84893483948848934839488489348394884893483948848934839488489348394884893483")

The memory leak issue is not restricted to the initialization routine, however. I also experience it in, for instance, an implementation of LLL that I recently wrote. Meanwhile, the following snippet does not leak memory:

from gmpy2 import mpz

while True:
  x = mpz("84893483948848934839488489348394884893483948848934839488489348394884893483")

It seems the issue is related to arithmetic involving the mpfr type.

Can someone else please confirm this? Is this already a known issue? Am I doing something wrong when I expect the garbage collector to handle freeing memory for the mpfr type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0