From: Johan L. <jo...@Da...> - 2005-01-10 23:16:52
|
Recently a TGL user noticed a memory leak when TGL is running. http://groups.yahoo.com/group/theguiloft/message/593 After an evening of trying to isolate this I've found that it's related to Win32::GUI, and it happens when: - A Timer - on a Win32::GUI::Window with the $win->{-dialogui} = 1 or on a Win32::GUI::DialogBox - fires off an event (an event handler sub doesn't need to exist) This example program demonstrates the leak. Open the Task Manager and watch the perl.exe process grow a couple of K/sec. Note that the mem usage can vary when the windows get/lose focus, that's not the leak. #!/usr/local/bin/perl -w $|++; use strict; use Win32::GUI; my $winTimer = Win32::GUI::Window->new( -name => "winTimer", -left => 50, -top => 50, -height => 200, -width => 300, -text => "Test timer mem leak", ); $winTimer->{-dialogui} = 0; #1 => leak, 0 => no leak my $timTimer = $winTimer->AddTimer("timTimer", 10); #100 times/sec $winTimer->Show(); Win32::GUI::Dialog(); sub ::timTimer_Timer { print ","; } __END__ This seems entirely related to the -dialogui setting, using a Win32::GUI::DialogBox and setting the -dialogui to 0 doesn't result in a leak. Win32::GUI 1.0 This is perl, v5.8.3 built for MSWin32-x86-multi-thread (with 8 registered patches, see perl -V for more detail) /J -------- ------ ---- --- -- -- -- - - - - - Johan Lindström Sourcerer @ Boss Casinos johanl AT DarSerMan.com Latest bookmark: "TCP Connection Passing" http://tcpcp.sourceforge.net/ dmoz: /Computers/Programming/Languages/JavaScript/ 12 |
From: Jez W. <je...@je...> - 2005-01-11 09:18:49
|
Hi Johan, I get the same results as you - I've created a tracker item for this bug. Cheers, jez. ----- Original Message -----=20 From: "Johan Lindstrom" <jo...@Da...> To: <per...@li...> Sent: Monday, January 10, 2005 11:15 PM Subject: [perl-win32-gui-hackers] Timer memory leak with -dialogui =3D 1 > Recently a TGL user noticed a memory leak when TGL is running. > http://groups.yahoo.com/group/theguiloft/message/593 > > After an evening of trying to isolate this I've found that it's related= to=20 > Win32::GUI, and it happens when: > - A Timer > - on a Win32::GUI::Window with the $win->{-dialogui} =3D 1 or on a=20 > Win32::GUI::DialogBox > - fires off an event (an event handler sub doesn't need to exist) > > This example program demonstrates the leak. Open the Task Manager and=20 > watch the perl.exe process grow a couple of K/sec. Note that the mem us= age=20 > can vary when the windows get/lose focus, that's not the leak. > > > > #!/usr/local/bin/perl -w > $|++; > use strict; > use Win32::GUI; > > my $winTimer =3D Win32::GUI::Window->new( > -name =3D> "winTimer", > -left =3D> 50, > -top =3D> 50, > -height =3D> 200, > -width =3D> 300, > -text =3D> "Test timer mem leak", > ); > > $winTimer->{-dialogui} =3D 0; #1 =3D> leak, 0 =3D> no leak > > my $timTimer =3D $winTimer->AddTimer("timTimer", 10); #100 times/sec > > $winTimer->Show(); > Win32::GUI::Dialog(); > > > sub ::timTimer_Timer { > print ","; > } > > __END__ > > > This seems entirely related to the -dialogui setting, using a=20 > Win32::GUI::DialogBox and setting the -dialogui to 0 doesn't result in = a=20 > leak. > > > Win32::GUI 1.0 > This is perl, v5.8.3 built for MSWin32-x86-multi-thread > (with 8 registered patches, see perl -V for more detail) > > > /J > -------- ------ ---- --- -- -- -- - - - - - > Johan Lindstr=F6m Sourcerer @ Boss Casinos johanl AT DarSerMan.com > > Latest bookmark: "TCP Connection Passing" > http://tcpcp.sourceforge.net/ > dmoz: /Computers/Programming/Languages/JavaScript/ 12 > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Perl-Win32-GUI-Hackers mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers >=20 |
From: Reini U. <ru...@x-...> - 2005-01-13 10:26:10
|
Johan Lindstrom schrieb: > Recently a TGL user noticed a memory leak when TGL is running. > http://groups.yahoo.com/group/theguiloft/message/593 > Win32::GUI 1.0 > This is perl, v5.8.3 built for MSWin32-x86-multi-thread > (with 8 registered patches, see perl -V for more detail) A test against a current perl would have been better. (5.8.6) But it's probably just a simple GUI.xs problem. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |