UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C++
  • » Memory is not deleted!

#1 2006-07-17 10:56 AM

Lloyd
Member
Registered: 2006-02-13
Posts: 53

Re: Memory is not deleted!

I have written alinked list in a class. that is the class contains the address of the head of the list. and the list grows by allocating memory for the list structure ( standard C way of linked list). In the distructor of the class I have written code to delete the whole list except the head node.

I am using this class' object a static member of other class' public function. When the program is run each time (without terminating, that is after the first execution round user can again give inputs until he wishes to terminate the program) it became more and more slower.  When I checked the system monitoring tool, the memory is growing only, not freeing. But my destructor code for linked list is executing properly.

what could be the reaso for not freeing up the memory? Do I have to do anythig else to get the memory freed?

Awaiting for your reply.
Thanks and Regards,
         Lloyd.

Offline

#2 2006-07-17 11:05 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: Memory is not deleted!

Without seeing any code it's hard to tell...

Offline

#3 2006-07-17 03:47 PM

Lloyd
Member
Registered: 2006-02-13
Posts: 53

Re: Memory is not deleted!

Thanks a lot i3839. The problem was not with the linked list, but with another object and its dynamic memory allocation. Cleared the problem. Thanks.

Offline

  • Index
  • » C++
  • » Memory is not deleted!

Board footer

Powered by FluxBB