kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Negative memory usage reported when processes use a lot of memory #374

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
======================================
Call psutil.Process(<pid>).get_memory_info().rss
on a process which uses more than 2GB of memory

What is the expected output?
============================
A number larger than 2 billion

What do you see instead?
========================
A negative number

What version of psutil are you using? What Python version?
==========================================================
* I'm pretty sure I'm using the 32 bit version of psutil 0.7.0
* Python 2.7.3 (default, Apr 10 2012, 23:31:26) 
  [MSC v.1500 32 bit (Intel)] on win32

On what operating system? Is it 32bit or 64bit version?
=======================================================
* Windows7, 64 bit

Please provide any additional information below.
================================================
I was monitoring the memory usage of a process through time and
got the following numbers:

   12075008
   28250112
   28250112
   28246016
    ...
 1795465216
 1851506688
-2024525824
    ...
 -352120832
  -51957760
         -1
         -1
    ...

while the memory usage increased to over 8GB.

So, to me at least, it looks like an overflow.

I haven't verified if the bug is present in the 64bit version,
but for me it's hard to move to a 64bit Python because of the
(lack of) availability of a 64bit version of some libraries.

Original issue reported on code.google.com by Willem.J...@gmail.com on 7 May 2013 at 2:11

GoogleCodeExporter commented 9 years ago
Do you have the possibility to compile psutil and figure whether this happened 
in get_process_memory_info() [1] or get_process_memory_info_2() [2]?

https://code.google.com/p/psutil/source/browse/psutil/_psutil_mswindows.c?spec=s
vnc970f35bc9640ac32eb9f09de8c230e7f86a2466&r=73608ce0ff14125fead4dbb93da44233b9d
ea92f#578

https://code.google.com/p/psutil/source/browse/psutil/_psutil_mswindows.c?spec=s
vnc970f35bc9640ac32eb9f09de8c230e7f86a2466&r=73608ce0ff14125fead4dbb93da44233b9d
ea92f#643

Original comment by g.rodola on 14 May 2013 at 8:53

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 8 Jul 2013 at 5:34

GoogleCodeExporter commented 9 years ago
Ok, I should have fixed this in revision ea98d1686302.
If you notice anything weird please reopen.

Original comment by g.rodola on 9 Jul 2013 at 10:31

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 11 Jul 2013 at 8:54