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


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;


test = new char[20000000]; for(int i = 0; i< 20000000; i++) {
test[i] = 'a'; }
delete [] test; test = NULL; //q->PrintElements();
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 thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].