Opened 9 years ago
Closed 7 years ago
#3829 closed defect (worksforme)
Memory allocation tracking produces weird statistics
Reported by: | Henning Kiel | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Code Generation | Version: | |
Keywords: | Cc: | Martin Sjölund |
Description
Take this example. At the corresponding line no memory is allocated.
(Log file is from Compilation phase of compiler. SimCodeUtil.mo was translated)
Absyn.mo:
5274: public function isDerCref 5275: input Exp exp; 5276: output Boolean b; 5277: algorithm 5278: b := match exp 5279: case CALL(CREF_IDENT("der",{}),FUNCTIONARGS({CREF()},{})) then true; 5280: else false; 5281: end match; 5282: end isDerCref;
Absyn.c:
case 1: { /* Pattern matching succeeded */ #line 5280 "/Users/henning/src/OpenModelica/OMCompiler/Compiler/FrontEnd/Absyn.mo" mmc_set_current_pos("[/Users/henning/src/OpenModelica/OMCompiler/Compiler/FrontEnd/Absyn.mo:5280:5-5281:3]"); #line 5280 "/Users/henning/src/OpenModelica/OMCompiler/Compiler/FrontEnd/Absyn.mo" tmp1 = 0; #line 7157 OMC_FILE tmp5 = 1; break; }
omc-memory.txt:
5412416: [/Users/henning/src/OpenModelica/OMCompiler/Compiler/FrontEnd/Absyn.mo:5280:5-5281:3]
Change History (3)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
comment:3 by , 7 years ago
Milestone: | Future |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This is expected. The thing is we only record the line at the start of a statement, etc. So things like:
Becomes:
So for higher-order functions and compound expressions, you need to search for the functions calling this function. You also should compile some files without tracking memory (like Flags.mo), because things depending on the Flag will record the flag function as a position of memory allocation.
I use the following: