Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007505OCamlotherlibspublic2017-03-15 17:352017-03-15 20:48
Reporterliang.wang 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformMacOSOSXOS VersionEl Capitan
Product Version4.04.0 
Target VersionFixed in Version 
Summary0007505: Memory cannot be released after calling Bigarray.Genarray.change_layout.
DescriptionIf Bigarray.Genarray.change_layout is called upon a variable, the memory allocated for this variable will never be collected by GC. This increases the memory consumption significantly in some numerical applications.
Steps To ReproduceTest 1:
open Bigarray;;
for i = 0 to 10000 do
  let x = Genarray.create float64 c_layout [|1000;1000|] in
  Genarray.fill x 0.;
  Gc.compact ();
done;;

Test 2:
open Bigarray;;
for i = 0 to 10000 do
  let x = Genarray.create float64 c_layout [|1000;1000|] in
  let y = Genarray.change_layout x fortran_layout in
  Genarray.fill x 0.;
  Gc.compact ();
done;;

I tested on OSX, OCaml 4.04. Test 1 is totally fine, consumes about 30MB. Test 2 is bad, memory consumption exploded (over 30GB), simply because I added change_layout function.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-03-15 17:35 liang.wang New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker