View Issue Details

IDProjectCategoryView StatusLast Update
0000045OpenFOAM[All Projects] Bugpublic2010-10-07 18:03
Reporteruser17Assigned Tohenry 
PrioritylowSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSFedoraOS Version13
Product Version 
Fixed in Version 
Summary0000045: bubbleFoam - phiaPtr and phibPtr not deleted
DescriptionphiaPtr and phibPtr in createPhia.H and createPhib.H are not deleted after use.

Suggest maybe:

surfaceScalarField phib = *phibPtr;
delete phibPtr;

instead of

surfaceScalarField& phib = *phibPtr;
TagsModelling, Solver

Activities

henry

2010-09-22 16:13

manager   ~0000048

The storage for these fields is deleted at the end of the run along with all other storage allocated during the run.

What is the advantage of the additional complexity and copies of your proposal?

user17

2010-09-22 16:57

  ~0000049

None. It's stupid to make a copy.

It would still be good to delete them just before the program exits. I have a solver derived from it and had a (real) memory leak. The warnings about the phiPtr objects confused me at first.

If I called bubbleFoam using system() from another application, the memory would not be freed when bubbleFoam exits would it? I'm not saying I would do that with bubbleFoam...

henry

2010-09-22 17:29

manager   ~0000050

> It would still be good to delete them just before the program exits. I have a
> solver derived from it and had a (real) memory leak. The warnings about the
> phiPtr objects confused me at first.

Fair comment.

> If I called bubbleFoam using system() from another application, the memory
> would not be freed when bubbleFoam exits would it?

It should.

Anyway, I will consider a cleaner option for this kind of initialization.

henry

2010-09-22 17:48

manager   ~0000051

Resolved by commit e29ef43c0713557b7f08f33cb48503f34fec23c6

Issue History

Date Modified Username Field Change
2010-09-22 12:31 user17 New Issue
2010-09-22 16:11 henry Assigned To => henry
2010-09-22 16:11 henry Status new => assigned
2010-09-22 16:13 henry Note Added: 0000048
2010-09-22 16:13 henry Status assigned => feedback
2010-09-22 16:57 user17 Note Added: 0000049
2010-09-22 16:57 user17 Status feedback => assigned
2010-09-22 17:29 henry Note Added: 0000050
2010-09-22 17:48 henry Note Added: 0000051
2010-09-22 17:48 henry Status assigned => resolved
2010-09-22 17:48 henry Resolution open => fixed
2010-10-07 18:03 user2 Tag Attached: Modelling
2010-10-07 18:03 user2 Tag Attached: Solver