Skip navigation
lcrits
Currently Being Moderated

URLStream.readBytes always throw out of memory exception (errorID=1000)

Dec 15, 2013 6:38 PM

Tags: #urlstream #out_of_memory

When I try to load a file as 180MBytes by using URLStream.readBytes(). 

 

In some PCs, it's OK.

But in some PCs, there are always [out of memory] exception (errorID=1000) even such PC still had enough memory.

 

For example:

   Total memory is 2G, current used is 1.43G, but URLStream.readBytes() still throw such exception.

For file with little size such as 30M, there isn't such problem.

 

Could any body give some suggestion?

Best regards,

 

Sourcecode is very simple like:

  var myStream:URLStream;

  var inputBytes: ByteArray = new ByteArray();

  ... do load ...

  // load by progressive event. I only deal progress load once, and ignore all later progressive load events.

  // for example first 500KBytes was read.

  myStream(inputBytes,inputBytes.length);

  // load again when all datas is loaded completely. For example, 180MBytes should be read.

  try {

    myStream(inputBytes,inputBytes.length);

  }  catch(e:*) {

    // warning log

  }

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points