psutil 4.4.0 released – improved Linux memory metrics and OSX support

OK, here’s another psutil release. Main highlights of this release are more accurate memory metrics on Linux and different OSX fixes. Here goes. Linux virtual memory This new psutil release sets a milestone regarding virtual_memory() metrics on Linux which are now calculated way more precisely (see commit). Across the years different people complained that the numbers […]

Read More

psutil 4.2.0, Windows services and Python

New psutil 4.2.0 is out. The main feature of this is the support for Windows services: >>> list(psutil.win_service_iter()) [<WindowsService(name=’AeLookupSvc’, display_name=’Application Experience’) at 38850096>, <WindowsService(name=’ALG’, display_name=’Application Layer Gateway Service’) at 38850128>, <WindowsService(name=’APNMCP’, display_name=’Ask Update Service’) at 38850160>, <WindowsService(name=’AppIDSvc’, display_name=’Application Identity’) at 38850192>, …] >>> s = psutil.win_service_get(‘alg’) >>> s.as_dict() {‘binpath’: ‘C:WindowsSystem32alg.exe’, ‘description’: ‘Provides support for 3rd […]

Read More

How to always execute exit functions in Python

…or why atexit.register() and signal.signal() are evil UPDATE (2016-02-13): this recipe no longer handles SIGINT, SIGQUIT and SIGABRT as aliases for “application exit” because it was a bad idea. It only handles SIGTERM. Also it no longer support Windows because signal.signal() implementation is too different than POSIX. Many people erroneously think that any function registered […]

Read More

NetBSD support for psutil

Roughly two months have passed since I last announced psutil added support for OpenBSD platforms. Today I am happy to announce we also have NetBSD support! This was contributed by Thomas Klausner, Ryo Onodera and myself in PR #570. Differences with FreeBSD (and OpenBSD) NetBSD implementation has similar limitations as the ones I encountered with OpenBSD. Again, […]

Read More

OpenBSD support for psutil

OK, this is a big one: starting from version 3.3.0 (released just now) psutil will officially support OpenBSD platforms. This was contributed by Landry Breuil (thanks dude!) and myself in PR #615. The interesting parts of the code changes are this and this. Differences with FreeBSD As expected, OpenBSD implementation is very similar to FreeBSD‘s (which was already in place), that […]

Read More

psutil 3.0

Here we are. It’s been a long time since my last blog post and my last psutil release. The reason? I’ve been travelling! I mean… a lot. I’ve spent 3 months in Berlin, 3 weeks in Japan and 2 months in New York City. While I was there I finally had the chance to meet […]

Read More

Python and sendfile

sendfile(2) is a UNIX system call which provides a “zero-copy” way of copying data from one file descriptor (a file) to another (a socket). Because this copying is done entirely within the kernel, sendfile(2) is more efficient than the combination of “file.read()” and “socket.send()”, which requires transferring data to and from user space.  This copying […]

Read More