• Welcome to Valhalla Legends Archive.
 

Memory Leak

Started by 111787, May 18, 2005, 08:26 PM

Previous topic - Next topic

111787

What exactly does it mean, besides the obvious? What exactly causes a Memory Leak?

Kp

An ill-maintained memory faucet?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

111787

it makes perfect sense now, any serious answers?

Hdx

Something that keeps eating away at the end-user's ram. Just blocks of memory sitting there used up, with no purpose. Like loading data from a file and having the thing jsut sit in momory (prime example, during bnet's hashing functions, you have to load the files DWORDS at a time, they add up.)
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

K

Memory that is allocated that isn't deallocated.  For example in C/C++ allocating data using malloc/new and forgetting to free/delete[] it.  The memory is still marked as used by the system's memory manager, so it can't be used to fill another memory allocation request.

Adron

A Memory Leak can be described in many ways.

A. It could be any block of memory that remains allocated when the program finishes execution and has to be automatically freed by the OS.

B. It could be any allocated memory block to which there is no reference or pointer in the program.

C. It could be a program doing something, and after it's done that has a higher memory use than before.

D. It could be C, with the additional requirement that the memory use continues to grow without an upper bound as the program executes.


For A:

main()
{
    char *a = new char[100];
}


For B:

main()
{
    char *a = new char[100];
    a = 0;
}


For C:

func(int n)
{
   static int *ar[100];
   if(!ar[n]) ar[n] = new int;
}
main()
{
    func(1);
    func(2);
}


For D:

func(int n)
{
   struct item {
       int n;
       struct item *next;
   };
   static item *head;
   item *p;
   p = new item;
   p->n = n;
   p->next = head;
   head = p;
}
main()
{
    func(1);
    func(2);
}


111787

good thing Kp explained so well that I don't have to figure out what the rest of you guys are saying with your crazy big words like allocated memory block.

Kp

Quote from: 111787 on May 19, 2005, 02:03 PM
good thing Kp explained so well that I don't have to figure out what the rest of you guys are saying with your crazy big words like allocated memory block.

If you don't understand the idea of an allocated memory block, you really have no business managing memory.  If you aren't managing memory, you can't affect any potential leaks, which makes explaining them to you pointless.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Maddox

Quote from: Kp on May 19, 2005, 04:29 PM
Quote from: 111787 on May 19, 2005, 02:03 PM
good thing Kp explained so well that I don't have to figure out what the rest of you guys are saying with your crazy big words like allocated memory block.

If you don't understand the idea of an allocated memory block, you really have no business managing memory.  If you aren't managing memory, you can't affect any potential leaks, which makes explaining them to you pointless.

You are not a very good detector of sarcasm.  :P
asdf.

Kp

Quote from: Maddox on May 19, 2005, 05:03 PMYou are not a very good detector of sarcasm.  :P

Based on the original poster's comments, it seemed unlikely he had the presence of mind to be sarcastic, so I took him seriously.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Maddox

Quote from: Kp on May 19, 2005, 05:57 PM
Quote from: Maddox on May 19, 2005, 05:03 PMYou are not a very good detector of sarcasm.  :P

Based on the original poster's comments, it seemed unlikely he had the presence of mind to be sarcastic, so I took him seriously.

I think you need to get out more.
asdf.

MyndFyre

Quote from: Maddox on May 19, 2005, 10:09 PM
Quote from: Kp on May 19, 2005, 05:57 PM
Quote from: Maddox on May 19, 2005, 05:03 PMYou are not a very good detector of sarcasm.  :P

Based on the original poster's comments, it seemed unlikely he had the presence of mind to be sarcastic, so I took him seriously.

I think you need to get out more.
I think Kp's response was perfectly understandable.  *shrug*
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Yoni

A memory leak is what happens when you open a drawer, but forget to close it.

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Maddox

Quote from: MyndFyre on May 19, 2005, 10:40 PM
Quote from: Maddox on May 19, 2005, 10:09 PM
Quote from: Kp on May 19, 2005, 05:57 PM
Quote from: Maddox on May 19, 2005, 05:03 PMYou are not a very good detector of sarcasm.  :P

Based on the original poster's comments, it seemed unlikely he had the presence of mind to be sarcastic, so I took him seriously.

I think you need to get out more.
I think Kp's response was perfectly understandable.  *shrug*

Yeah, if you live under a rock.
asdf.