Skip to main content
Inspiring
February 15, 2018
Question

Hidden string allocation bug on iOS?

  • February 15, 2018
  • 3 replies
  • 1590 views

Hi,

Can you please, pretty please, with sugar on top fix this bug:

Tracker

It is more than 2 years old and is a serious issue for iOS platform.

What is the status of that bug?

I have tested it with AIR 29.0.0.103 Beta and it is still present.

Thanks,

Caslav

This topic has been closed for replies.

3 replies

chakyAuthor
Inspiring
June 3, 2018

Adobe,

Can you please fix this. This is killing performance on iOS.

One thing to add here is that when ever you instantiate Vector for non primitive type and assign it to a class variable allocates 6 Strings for every Vector instance on iOS only. That is just insane.

The string is not allocated if you for example add Vector to a Vector.

This will allocate 6 strings for every Vector:


public
var mVecs:Vector.<AnimatedParticleData>;

for
(var i:int = 0; i < 3000; i++) {
     mVecs = new Vector.<AnimatedParticleData>;
}

And this will not allocate any strings:

public var mVecs:Vector.<AnimatedParticleData>;
public var mAVec:Vector.<Vector.<AnimatedParticleData>>;

for
(var i:int = 0; i < 3000; i++) {
     mAVec[mAVec.length] = new Vector.<AnimatedParticleData>;
}

But popping Vector from Vector will also allocate 6 Strings for each pop:

for(i = 0, len = mAVec.length; i < len; i++) {
     mVecs = mAVec.pop();
}

This is super ugly bug. Is it possible that Adobe does not care that much to fix this memory hog ugly bug.

Colin Holgate
Inspiring
June 3, 2018

Preran​ is there a way to find out if there is any progress on this tracker issue?

I see that Daniel Sperl gave a suggested workaround of using Arrays instead of Vectors. I know that Vectors ought to be faster, but at least Arrays would use less memory.

Daniel wrote Starling, I would have thought he would have more direct contact with Adobe, and could perhaps ask one of his contacts if there is any progress.

chakyAuthor
Inspiring
June 3, 2018

The problem with replacing Vector to Array is that I can not do it for complex libraries that are already written like Box2D.

chakyAuthor
Inspiring
March 29, 2018

This is also happening if you put vector into anything and try to get. If you put Vector inside Vector or if you put Vector inside Array or if you cast variable to Vector like data as Vector.


Can you please please please fix this because it is very ugly bug that is affecting iOS performance a lot.

Thanks.

chakyAuthor
Inspiring
May 3, 2018

This bug is still not fixed in AIR 30.00.85 Beta.

This bug is limiting use of Vectors very much on iOS and it is affecting Starling users a lot.

Can you please fix this bug?

chakyAuthor
Inspiring
February 23, 2018

This is still present in 29.0.0.108 Beta.

Is there any chance that this is fixed before final 29 release?

It has huge impact on performance for iOS.

Inspiring
February 23, 2018

It's unlikely since it's very easy to not run into that bug and it's also only requested by a very few people.

chakyAuthor
Inspiring
February 23, 2018

Where did you get such information? Are you working for Adobe?

How do you know it is requested by very few people?

You say it is easy to not run into that bug? How it is so easy? Are you promoting bug driven development?

Is that the way how you develop applications, by avoiding bugs? Are you professional bug avoider?