hasMemory

Richard Gaskin ambassador at fourthworld.com
Fri Jun 10 11:47:39 EDT 2016


Peter TB Brett wrote:

 > On 10/06/2016 16:31, Richard Gaskin wrote:
 >
 >> From time to time it's useful to know how much RAM may be available
 >> to an application, to make decisions about loading data.
 >
 > No, it isn't useful.  Don't do this.
 >
 > At the very best, you'll have a Time-of-check-to-time-of-use error
 > (i.e. you check a condition time X, and do something that assumes the
 > condition at time Y, but in the intervening time something happens
 > elsewhere in the system that invalidates the condition).  And on most
 > operating systems, the result will be total lies.
 >
 > Just go ahead and load the data.  If it fails, then try a smaller
 > chunk.

I once got the same advice from Mark Lucas, the lead engineer for 
SuperCard, so it would be foolish for me to disregard the same guidance 
so consistently offered.

The challenge, however, is that currently most xTalks, including 
LiveCode, sometimes have difficulty reporting errors in low-memory 
conditions.  When bad enough, it can sometimes cause a crash before 
we're able to check "the result" and apply any remedy.

Any advice for working gracefully in potentially RAM-taxing routines?

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the Use-livecode mailing list