To make things fair I compared a script that makes and shows 10 windows with a script that makes and shows 1000 windows and I'm happy to report that the memory usage per window is, on average, 1.612kb. The script that showed 1000 windows used about 6mb of memory. The windows were created with only name, pos, size and text options. Don't forget that Perl with Win32::GUI loaded takes up about 4mb of RAM alone. Steve -----Original Message----- From: Jez White [mailto:[EMAIL PROTECTED] Sent: 03 February 2004 13:13 To: Stephen Pick; Win32-GUI Subject: Re: [perl-win32-gui-users] Memory Usage
Thanks for the detailed reply. I broke my app down and found it was taking about 2 meg for all the controls/windows - the rest was due to my code or other modules. I'm considering using a new design approach were I'll be using child windows as containers for groups of controls - potentially there could be lots of these windows - roughly how much memory does a window use? Cheers, jez. ----- Original Message ----- From: Stephen <mailto:[EMAIL PROTECTED]> Pick To: Jez White <mailto:[EMAIL PROTECTED]> ; Win32-GUI <mailto:perl-win32-gui-users@lists.sourceforge.net> Sent: Tuesday, February 03, 2004 10:47 AM Subject: RE: [perl-win32-gui-users] Memory Usage Yep, there's a "PERLWIN32GUI_USERDATA" structure for every control and window. This structure is chunky, and has references off to other structures in it, such as window names, cursors, accelerator tables, NEM events, etc. It could probably be optimized down. The reason it uses more memory is that it supports and does more stuff. When you're writing an application to do, say, a calculator, you know exactly what buttons and windows you want, where you want them, and what you're doing, so you can build your C windowing code around your final goal. When you compile it, things get optimized even more by the compiler. With Win32::GUI there is no "final goal" and everything the Perl coder could conceivably want to do has to be supported, making it's footprint quite large. Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Jez White Sent: 29 January 2004 09:51 To: Win32-GUI Subject: [perl-win32-gui-users] Memory Usage Hi, I've noticed that my app uses lots of memory on start up (35 M) compared to other "similar" applications (around 12 M) I'm on XP. I've got lots of windows and controls which are created at the start - is there Win32::GUI memory overhead for each control/window? Or should I start considering this as some sort of bug in my code? Cheers, jez.