Based purely upon your description, it sounds like you mysql threads are failing to get cleaned up.

In general, using multiple threads with DBI has been a no-no, because the third-party (vendor) libraries that underly many DBI/DBD implementations are not thread-safe and allocate resources on a per-process basis.

You can in most cases successfully use DBI from a multi-threaded app, but the safest way to do so, is to start a single, long-running thread that conducts all the interactions with the DB. When other threads in your application need to make DB calls, they should communicate their requirements to, and retrieve results from the single DBI thread via queues or other shared-memory constructs.

The best way to test this hypothesis would be to run a copy of your app that does everything that it does now, including spawning and ending the "DBI" threads, but comment out/remove the actual DBI code. If the app runs without accumulating dead threads once they are no longer actually making DBI connections, it's a fairly clear indication that DBI, or the underlying vendor libraries are failing to clean up and releae resources.

Beyond that test, the best approach to solving the problem is to create a vastly cut down version of your app that 'goes through the motions', without actually doing to much--reducing the code to the bare minimum that demonstrates the problem, and then post that here so that here so that we can advise further. It may also allow the raising of a bug report that might allow someone to see and fix a problem.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: Threads memory consumption is infinite by BrowserUk
in thread Threads memory consumption is infinite by Godsrock37

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.