× 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.




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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.