When I'm creating large lists with Table
I see the memory footprint increasing.
MemoryInUse[]/1024.
(* Out-> 16992.4 *)
data = Table[x, {x, 0, 10000}, {y, 10000}];
MemoryInUse[]/1024.
(* Out-> 408372. *)
I would expect that when I generate the same command data = Table[...]
just as above the memory would not increase but in fact it just allocates a new block of memory.
data = Table[x, {x, 0, 10000}, {y, 10000}];
MemoryInUse[]/1024.
(* Out -> 799041. *)
Why is that? Even when I do:
Clear[data];
MemoryInUse[]/1024.
(* Out-> 799044. *)
Is this expected behaviour or am I missing something? I can't seem to find a function that clears the memory.
I'm using Mathematica 8.0.4.0 on Windows 7