Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005047OCamlOCaml generalpublic2010-05-09 13:362013-09-05 11:51
Reportergerd 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusconfirmedResolutionopen 
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
There are no notes attached to this issue.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker