Topic: Possible Memory Leak
I reason to think that I may have recently introduced a memory leak in my code. Through all my various versions during decades of development of my code, I have always noted that the memory usage was rock solid stable. I have researched a bit on memory leaks and have seen some of the potential causes, like using pointers and allocate statements. However, I do not use those constructs in my code, I am a relative simpleton coder and do nothing fancy to my mind. For example, I just recently learned how to do inline formatting of write statements (D'oh!).
It looks like code I produced earlier this year is memory stable but the latest code seems to use an ever increasing amount of memory. The one notable new thing (other than the aforementioned inline formatting) for the code was the use of one integer*8 variable and its use in a common block. Common blocks are new to me and my code and I think I am doing this correctly but I suspect there can be the potential for alignment issues. I noted that I had the large integer declared after the common declaration, like so (Note MaxIt is a regular integer):
.
.
common / Iteration / Iter8,MaxIt
.
.
integer*8 Iter8
Not sure why I did it like that but could that cause a problem? This morning I changed the code everywhere the common block appears it to be more like:
.
.
integer*8 Iter8
common / Iteration / Iter8,MaxIt
.
.
I have rebuilt the code as above am testing the memory usage. If you can think of anything else that might cause memory leaks, please educate me. Thanks.
Rod