Skip Menu |

This queue is for tickets about the Win32-SystemInfo CPAN distribution.

Report information
The Basics
Id: 30894
Status: resolved
Priority: 0/
Queue: Win32-SystemInfo

People
Owner: cjohnston [...] cpan.org
Requestors: perl123 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: bug info: Memory exhausted
Date: Wed, 21 Nov 2007 23:32:54 +0800
To: bug-Win32-SystemInfo [...] rt.cpan.org
From: "xb liu" <perl123 [...] gmail.com>
Win32-SystemInfo-0.09 and 0.10 perl, v5.8.8 built for MSWin32-x86-multi-thread(with 18 registered patches, see perl -V for more detail),Binary build 822 [280952] provided by ActiveState http://www.ActiveState.com Built Jul 31 2007 19:34:48. OS: Microsoft Windows XP [Version 5.1.2600] CPU: intel Core(TM)2 Duo 2.2GHz Memory: 2G BUG Info: Memory exhausted try to run the following code, and see your memory usage information in Windows Task Manager. use Win32::SystemInfo; my %mHash = ( ); while (1) { Win32::SystemInfo::MemoryStatus(%mHash,"MB"); for (keys %mHash){print "$_: $mHash{$_}\n";} printf("%dM/%dM\n", ($mHash{TotalPhys} - $mHash{AvailPhys})/1.024, $mHash{TotalPhys} ); #sleep 1; }
This appears to be more of an issue with Win32::API than with Win32::SystemInfo. It's entirely possible that I'm doing something stupid while using Win32::API, so I'm not going to close this bug until I understand further what exactly is happening. For now, however, I think this is going to have to be categorized as a "Don't Do That/Known Issue" item.
This has been resolved in Win32::SystemInfo 0.11. It turns out that the typedefs and structures being used to make the Win32 calls are apparently left in memory and not cleaned up. Over repeated calls, this memory adds up. In ad-hoc testing, calling MemoryStatus 10,000 times caused memory to increase ~56MB in version 0.10. In version 0.11, less than 1MB memory change was noted.