May I ask if you are successfully using threading for your program, why to you want to fork as well? What are you going to do after you fork?
Note: I'm not condemning the use of fork here, just trying to see a way to a solution for you that avoids needing to re-write your entire application.
If, for example, you need to run an external command, then there are a couple of ways of approaching that that are known to work.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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".
| [reply] |
Like I said, I'm forking in order to not accumulate the memory leaks in the main program. Forking will increase the memory size of the new process only and get rid of it when it dies.
I have $tree = $tree->delete() and also undef ($tree). Also I put everything in a class and undefed the class, but I still see the memory increasing.
| [reply] |
Also I have moved use HTML::TreeBuilder::XPath; to the thread (with require) and this help me...
| [reply] [d/l] [select] |
I have same problem recently (threaded app with HTML::TreeBuilder::XPath).
I have downloaded and processed less than 6000 entries (html pages) but my program uses 2Gb! I have fixed this issue by adding $tree->delete() after I don't use it.
Thanks.
Roman | [reply] [d/l] [select] |