Discussion:
About the memory leak
Lambert Duijst
2002-11-27 11:27:25 UTC
Permalink
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 <viewml-***@viewml.com>.
To unsubscribe, E-mail to: <viewml-devel-***@viewml.com>
To switch to the DIGEST mode, E-mail to <viewml-devel-***@viewml.com>
To switch to the INDEX mode, E-mail to <viewml-devel-***@viewml.com>
Send administrative queries to <viewml-devel-***@viewml.com>
zhangxiaoguang
1999-09-02 01:39:13 UTC
Permalink
Hi :

I have checked the viewml 0.22 , I didn't find anything change for memory leaks .
I think you'd better don't use the exit() to exit vieml ,unless exception . You can add a button to the vieml or use a shortcut key such as ESC to exit . You can modifie main(...) function in the main.cpp as followed :

while(Fl::wait) {
if(Fl::event_key() == 27 ) // "ESC"
break;
}
Just do like this you can exit viewml .

I have not notice the startthread you mentioned , I will check it .

xiaoguang zhang

----- Original Message -----
From: "Lambert Duijst" <***@scantech-id.com>
To: "ViewML development list" <viewml-***@viewml.com>
Sent: Wednesday, November 27, 2002 7:27 PM
Subject: Re: About the memory leak
Post by Lambert Duijst
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
#############################################################
This message is sent to you because you are subscribed to
the mailing list <viewml-***@viewml.com>.
To unsubscribe, E-mail to: <viewml-devel-***@viewml.com>
To switch to the DIGEST mode, E-mail to <viewml-devel-***@viewml.com>
To switch to the INDEX mode, E-mail to <viewml-devel-***@viewml.com>
Send administrative queries to <viewml-devel-***@viewml.com

Continue reading on narkive:
Loading...