Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007514OCamlcompiler driverpublic2017-04-04 18:252017-04-14 17:01
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007514: -dtimings should also report memory consumption
DescriptionSome of our users are investigating compilation issues where a blowup happen in memory usage of the compiler, rather than time. The -dtimings option is useful to help users extract information on the problematic pass for people trying to fix time blowup issues, having memory consumption information would help similarly debug memory issues.

After briefly looking at the Gc module documentation ( [^] ), I believe that the following information would be useful and could be always reported for each -dtimings output line:

- the live_words value at the times the timer was started and stopped
- the maximum top_heap_words value reached while the timer was active

One could consider having a more verbose output available, enabled by an extra flags (-dtimings-gc-stats?), which would collect (Gc.print_stat) calls on start/stop for each timer, but that can be left for later.
Additional Information(The reason why we want those measurements to be convenient for users to perform is that they have their problematic codebase at hand, and it may be difficult for them to extract an easy-to-build repro-case, and it may be difficult for compiler developers to build their codebase.)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
gasche (administrator)
2017-04-04 20:53

In an email, S├ębastien Hinderer wrote:

> Well, if -dtimings starts to report memory-related infomration,
> then I'd say that "timings" stops to be an appropriate name. So
> since -dtimings is, AFAIK, not part of any official release
> yet, perhaps it is still a good moment to rename it to
> something more generic like -dstatistics? Or, if that's not
> desired, perhaps memory-related info would diserve its
> own -dmemory or whatever option?

I think that -dperfstats or something may indeed be a good idea. I would rather not have two separate -dtimings and -dmemory option, because I think it makes sense to have a single combined hierarchical printing of pass-per-pass information than two separate things being displayed. (But having more advanced options to ask for more specialized/verbose outputs would be reasonable.)
gasche (administrator)
2017-04-04 21:29

In fact I re-checked: -dtimings was released in 4.03 (it is GPR#306, although it would be easier to find if the Changes entry explicitly mentioned the option name), so it's harder to change the name now.
chambart (developer)
2017-04-05 14:57

I think it is ok to change the name of the option. It is a tool for compiler development, if anybody relied on it, they deserve to get their build broken. Especially given that the printing format changed, it would be better to break it in a clearly visible way.

As for the reported information, I think that the most important one is minor-words and major-words. Live words is too unreliable to if one does not trigger a complete collection (and we certainly don't want to do that by default).

- Issue History
Date Modified Username Field Change
2017-04-04 18:25 gasche New Issue
2017-04-04 18:29 gasche Additional Information Updated View Revisions
2017-04-04 20:53 gasche Note Added: 0017718
2017-04-04 21:29 gasche Note Added: 0017719
2017-04-05 14:57 chambart Note Added: 0017721
2017-04-14 17:01 doligez Status new => acknowledged

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker