Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007813OCamlruntime system and C interfacepublic2018-06-25 13:162018-06-25 17:02
Reporteranders.fugmann 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.06.1 
Target VersionFixed in Version 
Summary0007813: Calling Gc.major_slice stalls gc'ing
DescriptionWhen only allocating data on the major heap, and continuously calling Gc.major_slice, the gc gets into a state where it stops collecting.

The attached test exposes the problem, and results in OOM after a while.

Removing the call to Gc.major_slice, or extending the test to do allocations on the minor heap avoids the gc stall, and memory pressure stabilizes to allow the test to run forever.



Steps To ReproduceThe attached test exposes the problem on 4.06.1 and 4.07-trunk.
TagsNo tags attached.
Attached Files? file icon leak.ml [^] (263 bytes) 2018-06-25 13:16 [Show Content]
? file icon leak2.ml [^] (233 bytes) 2018-06-25 13:21 [Show Content]

- Relationships

-  Notes
(0019211)
anders.fugmann (reporter)
2018-06-25 13:22

test file leak.ml does not exhibit the problem as it does a minor heap allocation also. Uploaded leak2.ml which does expose the bug.
(0019212)
ivg (reporter)
2018-06-25 17:02

I've looked into it and it looks like a race condition, since `caml_major_collection_slice` resets `caml_allocated_words` to zero, even if no work is done and it couldn't be done until the minor heap is emptied, which is not possible because the GC is not triggered since there are no minor heap allocations in the example program and alloc_share doesn't trigger the GC since `caml_allocated_words` doesn't grow. Please, follow the link below, for the detailed explanation:

https://discuss.ocaml.org/t/bug-in-gc-major-slice/2174/2?u=ivg [^]

- Issue History
Date Modified Username Field Change
2018-06-25 13:16 anders.fugmann New Issue
2018-06-25 13:16 anders.fugmann File Added: leak.ml
2018-06-25 13:21 anders.fugmann File Added: leak2.ml
2018-06-25 13:22 anders.fugmann Note Added: 0019211
2018-06-25 17:02 ivg Note Added: 0019212


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker