4 Replies - 109 Views - Last Post: 27 July 2012 - 10:59 AM Rate Topic: -----

#1 rana2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-July 12

not freeing memory dynamically allocated

Posted 27 July 2012 - 10:24 AM

Hello all,

I was just wondering what problem might occur if I do not free up the dynamically allocated arrays that I create. I suppose it starts piling up in the RAM but does it stay forever? Like even if I restart my computer they can't stay right.

From my question I am sure you all understand that I am a newbie :) . Thanks in advance.
Rana


Is This A Good Question/Topic? 0
  • +

Replies To: not freeing memory dynamically allocated

#2 jimblumberg  Icon User is online

  • member icon

Reputation: 3113
  • View blog
  • Posts: 9,492
  • Joined: 25-December 09

Re: not freeing memory dynamically allocated

Posted 27 July 2012 - 10:32 AM

First the real solution is to delete/free the memory you use when you are finished with it. Now most if not all the current operating systems will return the memory used by your program to the free store at some point after your program exits, usually without requiring a reboot.

Also please stop with the big font. The default font is much less annoying.



Jim
Was This Post Helpful? 0
  • +
  • -

#3 TwoOfDiamonds  Icon User is offline

  • D.I.C Head

Reputation: 49
  • View blog
  • Posts: 245
  • Joined: 27-July 12

Re: not freeing memory dynamically allocated

Posted 27 July 2012 - 10:32 AM

while the application runs the computer will run slower and slower and might even crash at an advanced stage
Was This Post Helpful? 0
  • +
  • -

#4 Sushii  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 11-December 08

Re: not freeing memory dynamically allocated

Posted 27 July 2012 - 10:57 AM

The worst that can happen when you have a memory leak is the program crashing and/or computer crashing. Memory is set free when the program exits.

This post has been edited by Sushii: 27 July 2012 - 10:58 AM

Was This Post Helpful? 0
  • +
  • -

#5 rana2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-July 12

Re: not freeing memory dynamically allocated

Posted 27 July 2012 - 10:59 AM

View Postjimblumberg, on 27 July 2012 - 10:32 AM, said:

First the real solution is to delete/free the memory you use when you are finished with it. Now most if not all the current operating systems will return the memory used by your program to the free store at some point after your program exits, usually without requiring a reboot.

Also please stop with the big font. The default font is much less annoying.



Jim


Thanks Jim for your reply.And I have no idea why the font got so big. I remember fiddling with the "fonts" and "sizes" but didn't notice any change in my draft.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1