Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: threads causing memory leak

by holli (Monsignor)
on Sep 11, 2010 at 13:43 UTC ( #859755=note: print w/ replies, xml ) Need Help??


in reply to Re: threads causing memory leak
in thread threads causing memory leak

do you mean you create a new thread every 30 seconds?
Yes.
Do you ever ->join that thread?
No, i wait for it to finish.
Otherwise, I think you should use async.
async?

Update:
Using async does not help, same problem. joining the thread leads to:
Free to wrong pool 9f2520 not 3f4e10 at c:/strawberry/perl/vendor/lib/ +Win32/GUI.pm line 2703 during global destruction.


holli

You can lead your users to water, but alas, you cannot drown them.


Comment on Re^2: threads causing memory leak
Select or Download Code
Re^3: threads causing memory leak
by BrowserUk (Pope) on Sep 11, 2010 at 14:49 UTC
    No, i wait for it to finish.

    That's exactly what join does. But if you don't join it, it's memory is never returned to the memory pool.

    Free to wrong pool 9f2520 not 3f4e10

    That's a bug in Win32::GUI.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      WxPerl Windows will probably crash too. I will test it when I have some time.
        WxPerl Windows will probably crash too.

        Perhaps "bug" is too strong a term. Let's call it an "incompatibility".

        The problem as I understand it, is to with static data in XS modules on modules that were never designed to work with threads. I believe that it is impossible to correct this incompatibility from within threads.

        It requires modules like Win32::GUI, Tk (perhaps WxPerl), and many others, be modified to become compatible with threads.

        I have no experience of WxPerl, but I'd bet that the same techniques I use in Re: threads causing memory leak (No leak!) would work with it also.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        For the record, it's quite possible to use Wx with perl threads. Padre does it, for example.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://859755]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-09-02 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls