Opened 7 years ago
Closed 7 years ago
#1942 closed Bug (fixed)
Memory leak in timing code, incomplete fix
Reported by: | mdunphy | Owned by: | francesca |
---|---|---|---|
Priority: | low | Milestone: | 2017 WP |
Component: | OCE | Version: | v3.6 |
Severity: | minor | Keywords: | |
Cc: |
Description
Context
With timing enabled, we've found that the code gradually leaks memory and eventually gets terminated due to excessive memory usage
Could be related to #1600. Not the same as #1902 or #1836 because AGRIF was not enabled here, but solving this might also solve the AGRIF-on case.
Analysis
I ran valgrind on NEMO with timing enabled in an attempt to track it down, which flagged a few minor leaks -- a few dozen bytes lost once -- but it did not flag any major leaks that grow each time step.
Partial Fix
Attached is a patch for the minor leaks.
This is not a complete fix because the leak persists after applying the patch.
Commit History (2)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
9215 | francesca | 2018-01-12T12:25:59+01:00 | fix ticket #1942 in dev_merge_2017 |
9214 | francesca | 2018-01-12T12:23:19+01:00 | fix ticket #1942 in nemo_v3_6_STABLE |
Attachments (1)
Change History (8)
Changed 7 years ago by mdunphy
comment:1 Changed 7 years ago by dupontf
I agree with the changes. A new pointer needs only to point. The allocation beforehand will only create a space that is going to be lost afterwards. And during de-allacation of a fortran type structure, it is best practice to deallocate all members first.
comment:2 Changed 7 years ago by mocavero
What revision of the 3.6 stable version has been used for this tests? Which configuration? The analysis performed for #1600 reported no major leaks on NEMO3.6 stable rev. 7654, while an old revision (6287) of the NEMO3.6 stable showed the presence of major memory leaks when XIOS1 was used in attached mode (see ticket #1600).
comment:3 Changed 7 years ago by clevy
- Owner set to mocavero
- Status changed from new to assigned
comment:4 Changed 7 years ago by mocavero
- Owner changed from mocavero to francesca
- Severity set to minor
comment:5 Changed 7 years ago by francesca
In 9214:
comment:6 Changed 7 years ago by francesca
In 9215:
comment:7 Changed 7 years ago by francesca
- Resolution set to fixed
- Status changed from assigned to closed
Add patch to solve three minor memory leaks in timing.F90
Patch to fix three minor memory leaks in timing.F90