memory leak after calling a fortran function



Hi,
Please go through the below code
------------------------------------
#include <stdio.h>
#include <conio.h>

#ifdef __cplusplus
extern "C" {
#endif
void DICO(void);
#ifdef __cplusplus
}
#endif

int main()
{
DICO();
}
--------------------------------
Fortran subroutine:
------------------

subroutine dico()
write (*,*) 'Hello'
end
--------------------------------
Please note that I havn't allocated any memory but still the
following observations found

Debug build memory usage details
2816k before fortran function call
2940k After fortran function call
-----
124k Memory Leak ???

Release build memory usage details

2468k before fortran function call
2588k After fortran function call
-----
120k Memory Leak ???

Some memory constantly gets consumed by the process whenever I call
fortran subroutine.
When I removed the write statement, application is not leaking any
memory. Means .. write statement is giving some problem. But how it
could be ????

Regards,
Devendra

.



Relevant Pages

  • Re: allocatable non-dummy local variables and pointers to them
    ... must release the memory used by a process when the process terminates. ... I do remember that Fortran Powerstation 4.0 did have a memory leak ... digging to find whether it claims to be an f90 or f95 compiler. ... compiler has to behave for allocatables that get undefined allocation ...
    (comp.lang.fortran)
  • Re: Handling large datasets in Fortran
    ... Obviously, when you have too much data to fit in memory, you have to ... I have read that Fortran has exceptional abilities in the ... I then need to retrieve comparisons for a set of ... and subset the internal file using intrisics like WHERE and PACK? ...
    (comp.lang.fortran)
  • Re: segmentation fault on calloc
    ... It was written in Fortran and later translated by someone in C. ... segmentation comes in vcalc when it is called by my fortran sub. ... of calloc, it failed... ... Maybe I am calling my added function in a part that some memory have been ...
    (comp.unix.programmer)
  • Re: Writing output files to memory
    ... your data lives in memory. ... > Intel Fortran compiler. ... > party program to ... won't see any difference between a ramdisk and a normal disk. ...
    (comp.lang.fortran)
  • Re: recursion, stack, fortran
    ... technology has gone that I have just purchased a 4MByte memory stick ... One thing I found on arrival here in NM was an old IBM fortran manual. ... it was a Pound sign ... Dave Flower ...
    (comp.lang.fortran)