The mistake is most definitely mine...Once I started dissecting the script I determined the memory surge was coming from a different module I was using and how I was importing data with it...I realized as Robert states below that the loading the Win32::GUI DLL takes about 6 mb and after that it's quite minimal....My apologies..

phil


----- Original Message ----- From: "Robert May" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2007 5:35 PM
Subject: Re: [perl-win32-gui-users] memory management and Win32: :GUI


From: "pcourterelle" <[EMAIL PROTECTED]>
I've created several some simple scripts with Win32::GUI where there is
little more than a window, button and listview and the script is using 6 MB
of memory. The memory usage increase dramatically each time a button is
clicked or the listview is populated. (the buttons do nothing more than
insert a static text item into the listview  - literally "bob" The memory
usuage never seems to decrease dynamically when the listview is reset.

On 13/06/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Assuming you are using the latest version of Win32:GUI you don't need to do anything special regarding memory management. When objects go out of scope all memory and resources are released. Something else is going on - can you
post an example?

I might believe the 6MB, depending on what figure you're quoting as
'memory usage'.  On the Win98 box I have in front of me, for a single
blank window I get the follwoing figures (from WinTop):

Allocated:   2632K    3984K
In memory: 1080K    3032K
In use:         848K    2408K

That's close on 6MB of allocated memory - most of which is due to the
DLL's that are loaded:

Name                     Size
ADVAPI32.DLL     0x10000 Win32 ADVAPI32 core component
COMCTL32.DLL    0x88000 Common Controls Library
COMDLG32.DLL   0x2D000 Common Dialogs DLL
Cwd.dll                   0x5000 Perl Cwd
GDI32.DLL            0x26000 Win32 GDI Core component
GUI.dll                 0xBD000 Perl Win32::GUI
KERNEL32.DLL    0x7A000 Win32 Kernel core component
MSVCRT.DLL       0x46000 Microsoft C Runtime Library
perl.exe                 0xB000 Perl.exe
perl58.dll              0xC6000 Perl core DLL
SHELL32.DLL     0x155000 Win32 Shell common Dll
SHLWAPI.DLL      0x66000 Shell light-weight Dll
USER32.DLL        0x11000 Win32 USER32 core component
VERSION.DLL        0x6000 Win32 VERSION core component

But I agree with Jez that if you're seeing significant (and you don't
say what you think significant is) increases when clicking a button,
then that doesn't sound right.  Some (simple) code that exhibits the
problem, some information on what tool you're using to measure the
memory usage, and the figures that you see would allow us to see if
we're seeing the same problem.

Regards,
Rob.




Reply via email to