whizard is hosted by Hepforge, IPPP Durham

Opened 13 years ago

Closed 13 years ago

#422 closed defect (worksforme)

Memory consumption increases during event generation

Reported by: sschmidt Owned by: kilian
Priority: P3 Milestone: v2.0.6
Component: core Version: 2.0.5
Severity: normal Keywords: memory leak
Cc:

Description

The memory consumption by WHIZARD as shown top by increases during the generation of events.

A mtrace=all check using nagfor showed that

LEAK: Allocation 2002495 (size 16) = Z'43B65570' at line 596 of state_matrices.f90

was the only leak shown whose occurrence increased with increasing number of events generated. The section from state_matrices.f90 is

    if (associated (state%root)) then
       if (allocated (state%me))  deallocate (state%me)
       allocate (state%me (state%n_matrix_elements))   <--This is line 596
       state%me = 0
    end if

Attachments (1)

ticket422.sin (391 bytes) - added by sschmidt 13 years ago.
sin file I used

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by sschmidt

Attachment: ticket422.sin added

sin file I used

comment:1 Changed 13 years ago by sschmidt

Summary: Memory consumprion increasesduring event generationMemory consumprion increases during event generation

forgot to mention: the source code is from the subroutine state_matrix_freeze1

comment:2 Changed 13 years ago by Juergen Reuter

WK, did you have a look into this?

comment:3 Changed 13 years ago by Juergen Reuter

Summary: Memory consumprion increases during event generationMemory consumption increases during event generation

comment:4 Changed 13 years ago by kilian

Hmm... I can't reproduce this. valgrind (with gfortran) doesn't show anything in state_matrix_freeze1, and nagfor -mtrace=all gives an output file with 1M lines, but not a single one matching LEAK. Neither do I see memory growing in top.

I used the example file, just reducing the number of events for valgrind and -mtrace to finish in finite time.

comment:5 Changed 13 years ago by sschmidt

As an update: I still reproduce the increase in memory consumption:

For example the output of top at different times:

VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2007m 84m 4908 R 100.3 0.2 0:40.10 whizard
2092m 168m 4908 R 100.0 0.3 1:24.61 whizard
2525m 602m 4908 R 100.2 1.2 5:03.23 whizard
2892m 968m 4908 R 100.0 2.0 8:06.25 whizard
3318m 1.4g 4912 R 99.7 2.9 11:31.84 whizard
3526m 1.6g 4912 R 100.0 3.3 13:13.79 whizard
3651m 1.7g 4912 R 100.0 3.6 14:16.97 whizard

(current trunk on theoc01.desy.de using gfortran 4.6 and ticket422.sin)

Valgrind (+gfortran4.6) gives me an increasing amount of lost memory with a slope of (2368.21 +/- 0.08)bytes/event, also with ticket422.sin.

The output when using nagfor and nagfmcheck is also unchanged...

comment:6 Changed 13 years ago by sschmidt

After Updating to nagfor 5.2(775) the leak seams to disappear (nagfmcheck crashes, but some greps showed that the formerly undeallocated memory from the line mentioned above, are now deallocated)

comment:7 Changed 13 years ago by ohl

Resolution: worksforme
Status: newclosed

Probably gfortran compiler bug (NAG works)

Note: See TracTickets for help on using tickets.