Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

G'day boleary,

I ran a few tests and can confirm your findings.

I made a very small change to your code to confirm completion:
Was: if (time() - $lastUpdate > 1) {
Now: if (time() - $lastUpdate > 1 or $_ == 5000000) {
And added the shebang: #!/usr/bin/env perl
Other than that, I ran exactly the code you posted
(modified code: C:\Users\ken\tmp\pm_11147080_tk_mem.pl).

I have Cygwin running on Win10:

$ uname -a CYGWIN_NT-10.0-19044 titan 3.3.6-341.x86_64 2022-09-05 11:15 UTC x86_6 +4 Cygwin

I have Perlbrew with a variety of Perl versions, each with Tk installed. I ran

ken@titan /cygdrive/c/Users/ken/tmp $ ./pm_11147080_tk_mem.pl

successfully to completion, without any error or warning messages, with these Perl & Tk combinations: 5.30.0/804.034, 5.32.0/804.035 & 5.36.0/804.036 (each using ~5.5GB memory, from visual inspection of Task Manager).

I don't use the MSWin side of my machine very often, doing nearly all of my work with Cygwin; however, I did have an old Strawberry Perl version with Tk:

Microsoft Windows [Version 10.0.19044.2075] (c) Microsoft Corporation. All rights reserved. C:\Users\ken\tmp>perl -v This is perl 5, version 26, subversion 3 (v5.26.3) built for MSWin32-x +64-multi-thread ... C:\Users\ken\tmp>perl -E "use Tk; say $Tk::VERSION" 804.034

I ran the script three times:

C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl Free to wrong pool 25e3ed0 not 10e38400 at pm_11147080_tk_mem.pl line +43. C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl Free to wrong pool 25c3ed0 not 2ee60830 at pm_11147080_tk_mem.pl line +43.

Each run died at about 4GB memory usage (from visual inspection of Task Manager) with the Tk application completely shutting down. Like you, I either got "Free to wrong pool ..." or no output at all. With the added shebang and a blank line after it, my line 43 should be the same as your line 41:

$MAIN_WINDOW->update();

I had a look in "Active bugs for Tk" but nothing really looked like it was relevant to this. There's apparently 144 in the list; I could have missed something; a second pair of eyes wouldn't hurt.

I would definitely advise raising a bug report. Before you do that, though, I'd await further reports from other monks. The more specific information you can supply, the easier it will be for maintainers to track down the problem. The type of such information could be, but is not limited to:

  • Occurs on MSWin only or others.
  • Occurs on Win10 only or others.
  • Occurs on Strawberry Perl only or others.
  • Occurs with Perl versions earlier than 5.26.3.
  • Occurs with Tk versions ealier than 804.034.

I acknowledge that you may already know this. You can consider it as a useful checklist for others.

— Ken


In reply to Re: Perl Tk crashes when mem usage exceeds 4G on Win10 by kcott
in thread Perl Tk crashes when mem usage exceeds 4G on Win10 by boleary

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found