comment 0

Lazy Memory Allocation On Modern operating systems?

Two applications I use regularly, Google Drive and Backblaze, allocate enormous pools of memory as they build lists of files to synchronize.  In this case, Google Drive has been granted 1.5GB of memory out of the 4GB of physical RAM available to the system, and my immediate performance was very poor until the Mac OS could free enough pages to respond to my requests.

I think, ideally, a developer could foist upon the OS the responsibility of ensuring enough free pages exist to service other requests in a timely fashion, but practical limitations of swapping pages makes for an unpleasant experience for the user, one that leaves me wondering if it’s acceptable in 2012 for developers to grow data structures with wild abandon on the assumption that virtual memory will accommodate both their and also the user’s needs.  I am of the opinion that it is too early to do so, and developers would be well served to spool their structures to disk as temporary files, and continue to treat memory as an costly resource.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s