Problem Deleting Part of a Linked List
I am writing an IRC-like chat server but have come up onto a problem. I have a class called cChannelHandler that handles all the channel issues. I ran a test script that created 20000 Channels which are structures calles sChannels. These structures are linked lists. Creating them goes fine. according to /proc/pid/status the memory usage does rise. But when I delete the lists the memory usage is still increasing according to proc. I'm wondering if this is just a bug in linux or something I am doing wrong.
Below is a snippet of the RemoveChannel Function
tempchan = GetChannel(*channum); //Returns A Channel Pointer
if(*channum == 0)
tempchan = ChannelList->next;
ChannelList = tempchan;
tempchan2 = tempchan->next;
tempchan->next = NULL;
GetChannel((*channum) - 1)->next = tempchan2;
Please help me out here. what is causing this program to increase memory usage when I delete.