question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak when casting np.float32 to int with Numpy 1.14.0

See original GitHub issue

Hello, running the code below with Numpy 1.14.0 will result in fast growing memory usage until the OS kills the process.

import numpy as np
test = np.float32(3.14)
while True:
    x = int(test)

Tested with Python 2.7.12 on Win10 x64 and on Linux Mint 17.4 x64.


The bug is not reproducible with Python 3.6.3.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sebergcommented, Jan 26, 2018

Hehe, OK, I already did it anyway, just two lines of code 😃, there is a second conversion step in Py2, and there was a DECREF missing.

0reactions
jbarthelmescommented, Jan 26, 2018

@seberg I’m not a Python dev, so no.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leak when returing a numpy array - Stack Overflow
I am analyzing a large amount of data with numpy/pandas by sorting ... may be caused by the extra memory allocated by np.ndarray.flatten()...
Read more >
Release Notes — NumPy v1.14 Manual
The change in 1.14.0 that multi-field indexing of structured arrays returns a view instead of ... #9746 BUG: Memory leak in np.dot of...
Read more >
Release Notes — NumPy v1.14 Manual
Numpy 1.14.0 is the result of seven months of work and contains a large number of bug fixes ... #9746 BUG: Memory leak...
Read more >
14 Simple Tips to save RAM memory for 1+GB dataset - Kaggle
import pandas as pd import numpy as np import warnings ... Average memory usage for float columns: 14.07 MB Average memory usage for...
Read more >
1541 NumPy 1150 Release Notes 411 NumPy User Guide Release ...
For simplicity, for generalized ufuncs that operate on 1-dimensional arrays (vectors), a single integer is accepted insteadof a single-element tuple, and for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found