× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi mark,
Thanks for the response. I tryed replacing the "new" with "malloc", i have the same results. The temporary memory is still not realeased. I'll keep looking for other options, any help will be helpful
Thanks

Date: Fri, 18 May 2012 19:07:48 -0400
From: mark.s.waterbury@xxxxxxxxxxxxx
To: c400-l@xxxxxxxxxxxx
Subject: Re: [C400-L] memory deallocation with delete

Victor:

Carefully study this page in the IBM ILE C/C++ Programmer's Gude:


http://publib.boulder.ibm.com/infocenter/iadthelp/v7r5/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/cpprog605.htm

HTH,

Mark S. Waterbury

> On 5/18/2012 3:55 PM, Victor Gonzalez wrote:
hello everyone,
Trying to debug a memory leak in a program, written in C++ and compiled with ILE C++ compiler, i found an odd behavior with the temporary memory allocation in the AS400.when i run the following piece of code:
int main(){
char *test;

sleep(10);

test = new char[20000000]; for(int i = 0; i< 20000000; i++) {
test[i] = 'a'; }
sleep(10);
delete [] test; test = NULL; //q->PrintElements();
sleep(5);
}
i found that the temporary storage used is not released after the calling "delete". The temporary storage used i use, is the one that could be seen with the command DSPJOBD
In other test's if found that after allocating other kind of objects, calling the delete operator immediately release the memory previously allocated.
For compilation i use STDMDL *teraspace. The rest of the options are the default
Any "enlightenment" about this behavior will be welcome
Thanks in advance.
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.