threads and malloc/free on freebsd 8.0
Vikash.Badal at is.co.za
Fri Jun 11 20:14:18 UTC 2010
> -----Original Message-----
> From: owner-freebsd-questions at freebsd.org [mailto:owner-freebsd-
> questions at freebsd.org] On Behalf Of Dan Nelson
> Sent: 11 June 2010 09:56 PM
> To: Vikash Badal
> Cc: freebsd-questions at freebsd.org
> Subject: Re: threads and malloc/free on freebsd 8.0
> The fix is to remove your second call to malloc_usable_size(z)). Then
> neither version will crash. Also, a useful habit to start is to
> zero the pointer you just free'd, to prevent it from being used
Made this change:
LogMessage(DEBUG_0, "allocated %ld", malloc_usable_size(inst));
Still no seg fault.
The reason im am doing this is that from top I can see the memory grow as I connect to this app.
When I disconnect, the memory used ( as displayed from top ) does not decrease.
chunk = (char*) malloc(1200000);
Top show the memory for the chunk section increase and then decrease when freed
However, the when I leave the worker thread ( close the connection ), the memory usage does not decrease.
The more connections I open and close, the faster the memory grows.
> Dan Nelson
> dnelson at allantgroup.com
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-
> unsubscribe at freebsd.org"
Please note: This email and its content are subject to the disclaimer as displayed at the following link http://www.is.co.za/legal/E-mail+Confidentiality+Notice+and+Disclaimer.htm. Should you not have Web access, send a mail to disclaimers at is.co.za and a copy will be emailed to you.
More information about the freebsd-questions