Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007505OCamlotherlibspublic2017-03-15 17:352017-03-31 17:04
Reporterliang.wang 
Assigned Todoligez 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformMacOSOSXOS VersionEl Capitan
Product Version4.04.0 
Target VersionFixed in Version4.04.1+dev 
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
(0017712)
doligez (administrator)
2017-03-31 17:04

Fixed (with Xavier's help) in:
 trunk (commits 0efcd9f4a3608b5ba7c804c3cf4f62ead67f2219 and c00cc83676293709806e453c26aba902e0f28a8f)
 4.05 (commits 1726715eabc4a561c6b29ebbe8e9a727a01b6841 and 6a702d195c6c0475e3e9302e0c1cd007496eeba4)
 4.04 (commits 3d3b8083de6ce4881d9253d54642eddef13da7a3 and 8bdb6425093107ab493d7f4427e49e17ece9cb0e)

- Issue History
Date Modified Username Field Change
2017-03-15 17:35 liang.wang New Issue
2017-03-31 16:15 doligez Assigned To => doligez
2017-03-31 16:15 doligez Status new => assigned
2017-03-31 17:04 doligez Note Added: 0017712
2017-03-31 17:04 doligez Status assigned => resolved
2017-03-31 17:04 doligez Resolution open => fixed
2017-03-31 17:04 doligez Fixed in Version => 4.04.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker