I remember having seen a presentation about objects being stored on the heap vs. stack with some interesting insights. But unfortunately I don’t find it any more.
Several Julia examples have been presented, using a struct called Box which was forced to be stored on the heap or on the stack. I think it was a talk held by @StefanKarpinski … but I’m not sure any more.
Can anybody give me a hint, where I can find this presentation? I would like to use that example in my next lecture on software engineering.
That statement is too strong. It depends on the granularity and size of the data that is stored on the heap. In fact some data will not even fit in the stack at all.
I think the intent of a statement like the one in the quote is to warn against storing lots of small boxed objects on the heap. To store a couple of huge arrays on the heap could be just fine performancewise.