Memprof support for unmarshalled data#8729
Conversation
|
This stayed on my "pile of things to look at urgently" for about a week now and I haven't had the time to look, nor will I have in the closure future. Sorry for the non-progress report. Writing tests definitely sounds like a good idea to me, though. |
|
It's also been on my pile, along with responding to your comments on #8731! I'll have time to do both on Monday, but not before. |
|
No worries, I am also rather busy these days. |
stedolan
left a comment
There was a problem hiding this comment.
Looks good! (This is a much smaller patch than I'd thought: I didn't realise that the regenerated .depend made up most of the changed lines)
I'm not completely sold on the mechanism for sharing stacks between samples within a single unmarshalling block. Making statmemprof go faster on unmarshalling allocations than on other allocations doesn't seem very important to me, because unmarshalling allocations are an uncommon case. (I'll do some benchmarking of this when I'm fixing up #8731).
0b2025f to
096b9be
Compare
|
The flambda Travis is doing a timeout. Looking at the log, it does not seem to be an infinite loop. Also, this timeout seems reproducible, since it has happened for each of the pushes of this PR. Usually the Travis CI for flambda lasts ~30min, and the timeout is set at 50min. So, it seems that this PR created a massive slowdown. I'm investigating. |
309b8d6 to
11d954b
Compare
11d954b to
8cc9c5f
Compare
|
This looks good to me! Good to merge once CI passes (which will need some |
Registering and unregistering global C roots was time consuming.
8cc9c5f to
90073e9
Compare
|
The conflicts are now solved, so we are just waiting for CI to succeed before merging. |
| intern_block = 0; | ||
| /* Free everything */ | ||
| intern_cleanup(); | ||
| return caml_check_urgent_gc(res); |
There was a problem hiding this comment.
Note: I think it would be nicer to have the same level of abstraction in the success and failure cases, with two intern_end_{success,failure} functions .
This PR implements memprof tracking for unmarshaled data.
This is performed by traversing the unmarshaled section after unmarshalling is complete. The reasons for not calling the memprof tracking function during unmarshaling are:
In addition to this, this PR implements memprof's own root tracking mechanism for the postponed queue. Calling the
caml_xxx_global_rootfunctions turned out to be rather slow.TODO: