You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7505 Reporter: liang.wang Assigned to:@damiendoligez Status: resolved (set by @damiendoligez on 2017-03-31T15:04:23Z) Resolution: fixed Priority: normal Severity: major Platform: Mac OS: OSX OS Version: El Capitan Version: 4.04.0 Fixed in version: 4.04.1+dev Category: otherlibs Monitored by:@hcarty
Bug description
If 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 reproduce
Test 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.
The text was updated successfully, but these errors were encountered:
Original bug ID: 7505
Reporter: liang.wang
Assigned to: @damiendoligez
Status: resolved (set by @damiendoligez on 2017-03-31T15:04:23Z)
Resolution: fixed
Priority: normal
Severity: major
Platform: Mac
OS: OSX
OS Version: El Capitan
Version: 4.04.0
Fixed in version: 4.04.1+dev
Category: otherlibs
Monitored by: @hcarty
Bug description
If 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 reproduce
Test 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.
The text was updated successfully, but these errors were encountered: