Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005047OCaml~DO NOT USE (was: OCaml general)public2010-05-09 13:362016-12-07 14:46
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version3.11.2 
Target VersionFixed in Version 
Summary0005047: feature wish: ocamlprof measures allocation rate
DescriptionOne of the more difficult parts in optimizing ocaml programs is the behavior of the garbage collector. Generally, allocating values is cheap, and freeing memory is expensive. The difficulty is that the consumption of CPU time for GC is delayed, and it is hard to connect it with the part of the program causing it. At least, time-based profilers cannot do it. (In gprof, one often only sees that GC-related functions are at the top of the flat profile, but it is impossible to get a clue why they consume time.)

The suggestion is that ocamlprof is extended so it can also count the number of allocations per function (both local and accumulated, i.e. with called functions). Under the assumption that the GC speed depends mainly on the number of blocks this can give an insight where in the program a lot of blocks are allocated, and it opens the strategy to optimize programs by avoiding allocations.
Additional InformationIn the past I had good success with this strategy, especially when the program has to deal mainly with small blocks. There are often easy ways to reduce the allocation rate if one only knew which blocks are allocated frequently, e.g. by making block sharing more likely. The optimizations are worth it even if most of such avoided allocations would be collected by the minor collector. It just means that the overall speed of the GC is reduced.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
shinwell (developer)
2016-12-07 14:46

Spacetime will solve all your memory problems.

- Issue History
Date Modified Username Field Change
2010-05-09 13:36 gerd New Issue
2010-05-21 13:49 doligez Status new => acknowledged
2013-09-05 11:51 doligez Status acknowledged => confirmed
2016-12-07 14:46 shinwell Note Added: 0016712
2016-12-07 14:46 shinwell Status confirmed => closed
2016-12-07 14:46 shinwell Resolution open => won't fix
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker