LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2002, 09:27 PM   #1
edreddy
Member
 
Registered: Jul 2002
Location: INDIA, Bangalore.
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34

Rep: Reputation: 15
Memory free problem


Hello all,

Will you please let me know what are reasons for which the allocated memory will not get released even though we are doing free using the delete.

i.e I am allocating the memory using "new" and de-allocating using "delete" But still the memory is not getting de-allocated.


Thanks In advance,
-edreddy.

Last edited by edreddy; 11-10-2002 at 03:33 AM.
 
Old 11-09-2002, 10:59 PM   #2
jamestwok
LQ Newbie
 
Registered: Oct 2002
Location: New Zealand
Distribution: Redhat 9.0
Posts: 14

Rep: Reputation: 0
It depends how you're allocating the memory, but one reason could be that you're allocating an array like

double *x = new double[10];

and then freeing it using

delete x;

when technically you should write

delete [] x;

James
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
free physical memory saavik Solaris / OpenSolaris 7 08-26-2005 12:22 PM
Still having Free memory issues..? sspiro Linux - Software 14 04-07-2005 06:13 PM
How much memory is really 'free'? robbiemorgan Linux - Newbie 4 09-19-2004 07:05 PM
free memory from strtok? swinchen Programming 1 09-08-2004 11:01 PM
free up unused memory im1crazyassmofo Linux - Hardware 1 01-20-2004 06:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration