Re: About the memory leak
Lambert Duijst <[email protected]> Wed, 27 Nov 2002 12:27:25 +0100
| Newsgroups | gmane.comp.web.viewml.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I am also looking at viewml to find it's memory leak(s). When viewml loads a new page it looks like it doesn't clean up everything. I am running viewml-0.21 (I see i have to check the 0.22 version) on an arm-linux platform with only 16MB of ram. So a memory leak is easily detected there. I used libmpr to find out if there is balance between malloc and free calls. I also got a lot of unfreed malloc's. The problem here is that I should terminate (call exit() or maybe even cause a segmentation fault ) viewml at a place in the code where it should have freed all it's recources that are used for the page that has just been flushed. Zhangxiaoguang, I'd like to know how you terminate viewml. What I did is remove the multithreading (just call runthread (this); in HTTPConnection::StartThread instead of pthread_create. Further I call exit just after delete clue in KHTMLWidget::parse (line 2000), but I am not sure this is the right place. Anyway, looking at /proc/meminfo I can see how much memory is consumed everytime a new page is loaded (with a resolution of 4Kbyte). It looks like pages with images cause a bigger memory leak, but I remember that this was already mentioned in the mailing list earlier. Furthermore I found out (with ddd / gdb ) that my list of threads only increases in size everytime a new page is loaded. This is strange and looks like one cause of a memory leak. It can be eliminated by calling pthread_exit(0) just before the end of HTTPConnection::runthread. Anyone else got a comment on this ?? , As I said before I also need to check the 0.22 version. Maybe it is already a lot better. One other thing: I tried to subscribe to the list, but I never received any mails after that, but I see in the archives that there are new mails. Could anyone add me please. Thanks Lambert Duijst ############################################################# This message is sent to you because you are subscribed to the mailing list <[email protected]>. To unsubscribe, E-mail to: <[email protected]> To switch to the DIGEST mode, E-mail to <[email protected]> To switch to the INDEX mode, E-mail to <[email protected]> Send administrative queries to <[email protected]>