On Sun, Jul 28, 2013 at 11:14 PM, Joshua Landau <jos...@landau.ws> wrote: > GC does have sometimes severe impact in memory-constrained environments, > though. See http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/, > about half-way down, specifically > http://sealedabstract.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-14-at-10.15.29-PM.png. > > The best verification of these graphs I could find was > https://blog.mozilla.org/nnethercote/category/garbage-collection/, although > it's not immediately clear in Chrome's and Opera's case mainly due to none > of the benchmarks pushing memory usage significantly. > > I also don't quite agree with the first post (sealedabstract) because I get > by *fine* on 2GB memory, so I don't see why you can't on a phone. Maybe IOS > is just really heavy. Nonetheless, the benchmarks aren't lying.
The ultimate in non-managed memory (the opposite of a GC) would have to be the assembly language programming I did in my earlier days, firing up DEBUG.EXE and writing a .COM file that lived inside a single 64KB segment for everything (256-byte Program Segment Prefix, then code, then initialized data, then uninitialized data and stack), crashing the computer with remarkable ease. Everything "higher level" than that (even malloc/free) has its conveniences and its costs, usually memory wastage. If you malloc random-sized blocks, free them at random, and ensure that your total allocated size stays below some limit, you'll still eventually run yourself out of memory. This is unsurprising. The only question is, how bad is the wastage and how much time gets devoted to it? ChrisA -- http://mail.python.org/mailman/listinfo/python-list