On Thursday, October 1, 2015 at 2:19:39 PM UTC, Milan Bouchet-Valat wrote: > > Le jeudi 01 octobre 2015 à 07:13 -0700, Matt a écrit : > I think it depends on where the memory comes from. If it comes from a > different process, the OS will fill it with zeros for security reasons. >
But certainly not performance reasons.. > > This illustrates the problem with the current situation: the returned > array is quite often full of zeros, which can lead people to believe > this is a guarantee. At least if it always contained obvious garbage, > the problem would be more visible. > I wander, since the zero filling by the OS is rare*, should Julia fill *those* pages (just those zero filled by the OS) with garbage. Possibly (at least mixed with) NaNs.. [I'm of the camp that is not convinced by a zero filling solution, and even if we end up with that this could be a stop-gap.] * Isn't it rare? It would only happen when the memory allocated to your process gets bigger. Does it ever get smaller? Even if you would return memory back to the OS and get it (repeatedly back), filling the memory in this way is O(n) on top of the O(n) the OS has to do anyway so doesn't count.. -- Palli.