in reply to Threads memory consumption is infinite
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threads memory consumption is infinite
by Godsrock37 (Sexton) on Jun 10, 2008 at 16:41 UTC | |
by BrowserUk (Patriarch) on Jun 10, 2008 at 16:45 UTC |