Garbage Collector questions

Howdy all,

I have a few questions about the cleaners of the flash.  I am a construction game and have all the elements in a container called _gameContainer sprite.

_gameConatiners contains the other sprites as _hudContainer which contains several containers such as _gameoverContainer, _menuContainer, etc.  So there is a whole hierarchy of containers that are all contained in _gameContainer which is added directly to the document class (not the scene btw).

All this should basically be step-> document-> _gameContainer-> etc. class.

When the player loses or wants to restart the game, I remove all event listeners (who are defined as weak, but still pretty sure that there are no ends), stopping the music and sounds, _gameContainer remove from the scene and then setting _gameContainer to null.   From there I re-request my function init that creates everything (_gameContainer and everything inside her, in addition to creating all the standard eventlisteners).

I do everything backwards?  It is * one * way to restart a game?  Mind you I do not say 'the' right way because I do not know there are a hundred different ways to do so.

In addition, on a separate note... If I have something like an enemy, I keep all enemy logic contained in the movieclip on the stage-bound class.  Who should be called Add/removechild?  Should I use a factory method that takes care of all this, or should I have the engine creates the enemy and then have the enemy withdraw from the scene?   I am currently using a mixture of both, but in general I have a function in the engine/caller add to the scene, then have the class have an ADDED_TO_STAGE event listener.  When the time comes to remove the class, I call his own removeself function such as: (_container is a reference to the container it is as mentioned above, for example _hudContainer)

protected function removeSelf():void
{
    if(_container.contains(this)) {
        _container.removeChild(this);
    }
    _container.parent.parent.dispatchEvent(new Event(Engine.START_GAME));
} 

Thank you!

Question of wonderful Travisism.

The garbage collection is strange.  First of all I am curious to know why you lump displayObjects in _gameConatiners.  _GameConatiners added to the scene at any point?  Why not just add to the point his need hud?

In any case.  By removing listeners, removeChild (_gameConatiners) and setting _gameConatiners = null does not mean that these classes are killed.  null value only marks the memory as locations without any reference to them.  When this happens, these objects can be removed from memory.  Why should I say may is because it takes a specific amount of memory used to trigger garbage collection.

Now just simply set _gameConatiners = null can never kill your objects.  You need to this profile and make sure they are die properly.  From the sounds of it, you have a lot of inner children.

There is reason to believe that in some cases, when an object is deleted main piles that his children will be so deleted.  Although, if the wheels are so large, often objects in SEO effects each other how the garbace collection is indicating that they are still in use.  Thus perpetuate these objects.

Its always better to kill all the references used.  You can do this by ensuring that each object in your class movieClip declared a method of slaughter and continue trickeling down each object.  This ensures that each object will be well marked.

Regarding your movieClips, a factory method is only for creating objects, never for deletion.

You are the best solution is to have an object that contains all the objects on the stage in a collection.  When you lose the game. Itterate through this collection and remove them from the scene there.

This would be in the concept of your engine.  There is no reason to use a displayObject to this since it's just an object.  Better yet, use a vector. to optimize it.

Back to your question is this * one * good way to reset.

Yes and no, the asnwer is based on the use of memory that eats your application and time to rebuild all the objects.  Ideally you should put together all the resources which can be reused and having to rebuild.

For example.  If you have a screen that says Game Over.  Why would you have to rebuild on a reset?  There is no information that has been changed.   Each instantiation clip takes the allocated memory and time.

Unfortunately, without seeing what you have it is hard to say.  But the init methods are good and it may be wise to rebuild objects to be again, but like I said it depends.

Finally, your line:

 _container.parent.parent.dispatchEvent(new Event(Engine.START_GAME));

Must not parent.parent references to breast.  If you create a new event, at least fall back on eventBubbling to allow the event to go to the parent.parent.

You should never aim relatives like this in a class.  Best practices is to parent.parent as a reference to the class.

What happens if you were to add a layer of parents to the _container.  Then, you will continue to edit parent.parent.parent.  At least if you bubble the event you do not have to be concerned about anything that listens.

Tags: Adobe Animate

Similar Questions

  • How do I know when the garbage collector/timer icon is active

    Hello

    I want to listen to changes on the phone screen, I saw peter made a suggestion in another thread a couple of years ago which resulted in using locateDfference, however, it signals a potential hole in his suggestion where, in the case where the display of the icon of the timer - the screen is constantly evolving but doesn't not really relevant to the screen are underway only the flag icon and network timer trigger changes.

    I'm now trying to fill the holes, my code detects the difference of bitmaps of the screenshots, the code works, but when the garbage collertor is active it triggers a change detected in my code.

    I think the easiest option is to ask the api is the garbage collector active - I printed visible applications and the garbage collector is never one of them, but I do not see that the processid is changing all the time and then maybe one of these processid I see in the console is the collecvtor of garbage and I can detect when it is active - does anyone know if I can find the processid of the garbage collector, or listen to it comes to about (the timer icon display)?

    If this is not possible then maybe if I can get a proper report to the timer by screen size then I can work around the icon.

    Any suggestions how to overcome my problems are welcome.

    Thank you.

    It's a shame...  Like Simon, I'm n0t aware of a way to detect that the gc is running or display the icon, sorry.

  • Battery drain and the Garbage collector?

    Hello

    I have big problems with the battery...

    To analyze these battery issues, I create a multiple event listener and this is what I get:

    07/12/2010 18:36:02 | Battery level changed : Battery : 91% (temp : 29 °C) | Signal : -90dbm (cellid : 3181)
    07/12/2010 18:36:24 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=1 data1=0)
    07/12/2010 18:36:24 | MemoryCleanerListener[EVENT_DEVICE_LOCK]
    07/12/2010 18:36:25 | Backlight changed : On
    07/12/2010 18:36:48 | Backlight changed : On
    07/12/2010 18:37:02 | Backlight changed : Off
    07/12/2010 18:37:09 | Backlight changed : On
    07/12/2010 18:37:14 | Backlight changed : On
    07/12/2010 18:37:25 | Backlight changed : Off
    07/12/2010 18:39:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 18:39:04 | Backlight changed : On
    07/12/2010 18:39:15 | Backlight changed : Off
    07/12/2010 18:39:22 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 18:39:45 | Backlight changed : On
    07/12/2010 18:39:57 | Backlight changed : Off
    07/12/2010 18:41:00 | Backlight changed : On
    07/12/2010 18:41:12 | Backlight changed : Off
    07/12/2010 18:41:33 | Backlight changed : On
    07/12/2010 18:41:48 | Backlight changed : Off
    07/12/2010 18:43:08 | Backlight changed : On
    07/12/2010 18:43:20 | Backlight changed : On
    07/12/2010 18:43:35 | Backlight changed : Off
    07/12/2010 18:44:01 | Backlight changed : On
    07/12/2010 18:44:03 | Network state changed : GPRS_STATE_READY
    07/12/2010 18:44:14 | Backlight changed : Off
    07/12/2010 18:44:17 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 18:44:43 | Backlight changed : On
    07/12/2010 18:44:55 | Backlight changed : Off
    07/12/2010 18:46:27 | Backlight changed : On
    07/12/2010 18:46:58 | Backlight changed : Off
    07/12/2010 18:49:55 | Backlight changed : On
    07/12/2010 18:50:06 | Backlight changed : Off
    07/12/2010 18:50:15 | Backlight changed : On
    07/12/2010 18:51:35 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=2 data1=0)
    07/12/2010 18:52:01 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=1 data1=0)
    07/12/2010 18:52:01 | MemoryCleanerListener[EVENT_DEVICE_LOCK]
    07/12/2010 18:52:05 | Backlight changed : On
    07/12/2010 18:52:19 | Backlight changed : Off
    07/12/2010 18:55:52 | Backlight changed : On
    07/12/2010 18:56:01 | Backlight changed : On
    07/12/2010 18:56:15 | Backlight changed : Off
    07/12/2010 18:57:38 | Backlight changed : On
    07/12/2010 18:57:47 | Backlight changed : On
    07/12/2010 18:58:01 | Backlight changed : On
    07/12/2010 18:58:40 | Backlight changed : On
    07/12/2010 18:59:03 | Network state changed : GPRS_STATE_READY
    07/12/2010 18:59:17 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 18:59:24 | Backlight changed : On
    07/12/2010 18:59:47 | Backlight changed : On
    07/12/2010 19:00:02 | Backlight changed : Off
    07/12/2010 19:04:01 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:04:07 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:04:22 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 19:06:00 | Backlight changed : On
    07/12/2010 19:06:21 | Backlight changed : Off
    07/12/2010 19:11:01 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:11:57 | Backlight changed : On
    07/12/2010 19:12:38 | Backlight changed : On
    07/12/2010 19:12:49 | Backlight changed : Off
    07/12/2010 19:13:51 | Backlight changed : On
    07/12/2010 19:14:40 | Backlight changed : On
    07/12/2010 19:15:13 | Backlight changed : On
    07/12/2010 19:15:29 | Backlight changed : On
    07/12/2010 19:15:34 | Backlight changed : On
    07/12/2010 19:15:49 | Backlight changed : On
    07/12/2010 19:15:56 | Backlight changed : On
    07/12/2010 19:16:05 | Backlight changed : On
    07/12/2010 19:16:21 | Backlight changed : Off
    07/12/2010 19:18:03 | Backlight changed : On
    07/12/2010 19:18:20 | Backlight changed : On
    07/12/2010 19:18:56 | Backlight changed : Off
    07/12/2010 19:19:08 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:19:22 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 19:19:45 | Backlight changed : On
    07/12/2010 19:20:32 | Backlight changed : On
    07/12/2010 19:20:41 | Backlight changed : On
    07/12/2010 19:20:53 | Backlight changed : Off
    07/12/2010 19:24:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:24:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 19:25:00 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:27:20 | Backlight changed : On
    07/12/2010 19:28:15 | Backlight changed : On
    07/12/2010 19:29:23 | Backlight changed : On
    07/12/2010 19:29:34 | Backlight changed : Off
    07/12/2010 19:34:01 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:39:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:39:17 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 19:42:41 | Backlight changed : On
    07/12/2010 19:43:01 | Backlight changed : Off
    07/12/2010 19:43:56 | Backlight changed : On
    07/12/2010 19:44:07 | Backlight changed : Off
    07/12/2010 19:46:15 | Backlight changed : On
    07/12/2010 19:46:27 | Backlight changed : Off
    07/12/2010 19:51:01 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:52:20 | Backlight changed : On
    07/12/2010 19:52:32 | Backlight changed : Off
    07/12/2010 19:52:34 | Backlight changed : On
    07/12/2010 19:52:46 | Backlight changed : Off
    07/12/2010 19:52:53 | Backlight changed : On
    07/12/2010 19:53:04 | Backlight changed : Off
    07/12/2010 19:54:03 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:54:17 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 19:57:01 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 19:59:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 19:59:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:14:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:14:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:19:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:19:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:34:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:34:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:39:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:39:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:46:36 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:46:50 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:54:03 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:54:17 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 20:59:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 20:59:15 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:10:34 | Backlight changed : On
    07/12/2010 21:10:41 | Backlight changed : On
    07/12/2010 21:10:41 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=2 data1=0)
    07/12/2010 21:11:27 | Backlight changed : Off
    07/12/2010 21:12:53 | Battery level changed : Battery : 89% (temp : 22 °C) | Signal : -74dbm (cellid : 3178)
    07/12/2010 21:14:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 21:14:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:14:53 | Battery level changed : Battery : 87% (temp : 24 °C) | Signal : -74dbm (cellid : 3178)
    07/12/2010 21:15:00 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 21:16:53 | Battery level changed : Battery : 85% (temp : 24 °C) | Signal : -73dbm (cellid : 3178)
    07/12/2010 21:18:53 | Battery level changed : Battery : 83% (temp : 25 °C) | Signal : -73dbm (cellid : 3178)
    07/12/2010 21:19:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 21:19:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:20:53 | Battery level changed : Battery : 81% (temp : 25 °C) | Signal : -73dbm (cellid : 3178)
    07/12/2010 21:22:53 | Battery level changed : Battery : 79% (temp : 26 °C) | Signal : -73dbm (cellid : 3178)
    07/12/2010 21:22:53 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 131mb free / 146mb
    RAM Memory free: 7mb free / 23mb
    RAM Object count: 267k    (14mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 176k free / 512k   (14mb)
    =======================================================================================
    
    07/12/2010 21:24:53 | Battery level changed : Battery : 78% (temp : 26 °C) | Signal : -66dbm (cellid : 14168)
    07/12/2010 21:28:53 | Battery level changed : Battery : 77% (temp : 27 °C) | Signal : -64dbm (cellid : 14168)
    07/12/2010 21:30:53 | Battery level changed : Battery : 76% (temp : 27 °C) | Signal : -64dbm (cellid : 14168)
    07/12/2010 21:33:20 | Backlight changed : On
    07/12/2010 21:34:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 21:34:13 | Backlight changed : Off
    07/12/2010 21:34:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:34:53 | Battery level changed : Battery : 75% (temp : 28 °C) | Signal : -75dbm (cellid : 14168)
    07/12/2010 21:34:54 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 131mb free / 146mb
    RAM Memory free: 6mb free / 23mb
    RAM Object count: 279k    (15mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 164k free / 512k   (15mb)
    =======================================================================================
    
    07/12/2010 21:38:00 | MemoryCleanerListener[EVENT_IDLE_TIMEOUT]
    07/12/2010 21:38:54 | Battery level changed : Battery : 74% (temp : 28 °C) | Signal : -75dbm (cellid : 14168)
    07/12/2010 21:39:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 21:39:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:40:54 | Battery level changed : Battery : 73% (temp : 28 °C) | Signal : -75dbm (cellid : 14168)
    07/12/2010 21:44:54 | Battery level changed : Battery : 72% (temp : 29 °C) | Signal : -75dbm (cellid : 14168)
    07/12/2010 21:48:54 | Battery level changed : Battery : 71% (temp : 29 °C) | Signal : -75dbm (cellid : 14168)
    07/12/2010 21:48:54 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 129mb free / 146mb
    RAM Memory free: 4mb free / 23mb
    RAM Object count: 390k    (16mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 53k free / 512k   (16mb)
    =======================================================================================
    
    07/12/2010 21:50:54 | Battery level changed : Battery : 70% (temp : 29 °C) | Signal : -73dbm (cellid : 14168)
    07/12/2010 21:54:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 21:54:15 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 21:54:54 | Battery level changed : Battery : 69% (temp : 30 °C) | Signal : -73dbm (cellid : 14168)
    07/12/2010 21:58:54 | Battery level changed : Battery : 68% (temp : 30 °C) | Signal : -73dbm (cellid : 14168)
    07/12/2010 22:02:54 | Battery level changed : Battery : 67% (temp : 30 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:02:55 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 133mb free / 146mb
    RAM Memory free: 9mb free / 23mb
    RAM Object count: 173k    (12mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 270k free / 512k   (12mb)
    =======================================================================================
    
    07/12/2010 22:04:54 | Battery level changed : Battery : 66% (temp : 31 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:08:55 | Battery level changed : Battery : 65% (temp : 31 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:09:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 22:09:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 22:10:55 | Battery level changed : Battery : 64% (temp : 31 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:12:55 | Battery level changed : Battery : 63% (temp : 31 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:12:55 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 128mb free / 146mb
    RAM Memory free: 4mb free / 23mb
    RAM Object count: 418k    (17mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 26k free / 512k   (17mb)
    =======================================================================================
    
    07/12/2010 22:14:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 22:14:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 22:14:55 | Battery level changed : Battery : 62% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:17:01 | Global event Occured : GUID_FLASH_LOW (guid=945659952435832745 data0=0 data1=0)
    07/12/2010 22:18:55 | Battery level changed : Battery : 61% (temp : 31 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:20:55 | Battery level changed : Battery : 59% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:22:55 | Battery level changed : Battery : 58% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:22:55 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 129mb free / 146mb
    RAM Memory free: 5mb free / 23mb
    RAM Object count: 370k    (16mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 73k free / 512k   (16mb)
    =======================================================================================
    
    07/12/2010 22:24:55 | Battery level changed : Battery : 57% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:26:55 | Battery level changed : Battery : 55% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:28:55 | Battery level changed : Battery : 54% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:29:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 22:29:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 22:30:55 | Battery level changed : Battery : 53% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:30:56 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 128mb free / 146mb
    RAM Memory free: 4mb free / 23mb
    RAM Object count: 409k    (17mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 34k free / 512k   (17mb)
    =======================================================================================
    
    07/12/2010 22:32:55 | Battery level changed : Battery : 52% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:34:55 | Battery level changed : Battery : 51% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:38:56 | Battery level changed : Battery : 50% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:40:56 | Battery level changed : Battery : 48% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:40:56 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 131mb free / 146mb
    RAM Memory free: 7mb free / 23mb
    RAM Object count: 267k    (14mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 176k free / 512k   (14mb)
    =======================================================================================
    
    07/12/2010 22:42:56 | Battery level changed : Battery : 47% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:44:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 22:44:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 22:44:56 | Battery level changed : Battery : 46% (temp : 32 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:46:56 | Battery level changed : Battery : 44% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:48:56 | Battery level changed : Battery : 42% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:48:56 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 130mb free / 146mb
    RAM Memory free: 6mb free / 23mb
    RAM Object count: 306k    (15mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 137k free / 512k   (15mb)
    =======================================================================================
    
    07/12/2010 22:49:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 22:49:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 22:50:56 | Battery level changed : Battery : 41% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:52:56 | Battery level changed : Battery : 40% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:54:56 | Battery level changed : Battery : 39% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:56:56 | Battery level changed : Battery : 37% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 22:56:56 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 128mb free / 146mb
    RAM Memory free: 3mb free / 23mb
    RAM Object count: 442k    (17mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 1k free / 512k   (18mb)
    =======================================================================================
    
    07/12/2010 22:57:01 | Global event Occured : GUID_FLASH_LOW (guid=945659952435832745 data0=0 data1=0)
    07/12/2010 22:58:56 | Battery level changed : Battery : 35% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:00:56 | Battery level changed : Battery : 34% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:02:56 | Battery level changed : Battery : 33% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:04:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:04:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:04:57 | Battery level changed : Battery : 32% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:04:57 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 135mb free / 146mb
    RAM Memory free: 10mb free / 23mb
    RAM Object count: 94k    (11mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 350k free / 512k   (11mb)
    =======================================================================================
    
    07/12/2010 23:06:57 | Battery level changed : Battery : 31% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:08:57 | Battery level changed : Battery : 29% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:10:57 | Battery level changed : Battery : 28% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:12:57 | Battery level changed : Battery : 26% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:12:57 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 134mb free / 146mb
    RAM Memory free: 9mb free / 23mb
    RAM Object count: 134k    (11mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 309k free / 512k   (11mb)
    =======================================================================================
    
    07/12/2010 23:16:01 | Global event Occured : GUID_FLASH_LOW (guid=945659952435832745 data0=0 data1=0)
    07/12/2010 23:16:57 | Battery level changed : Battery : 25% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:19:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:19:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:20:57 | Battery level changed : Battery : 24% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:22:57 | Battery level changed : Battery : 23% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:24:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:24:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:26:57 | Battery level changed : Battery : 22% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:26:58 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 134mb free / 146mb
    RAM Memory free: 10mb free / 23mb
    RAM Object count: 109k    (11mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 334k free / 512k   (11mb)
    =======================================================================================
    
    07/12/2010 23:30:57 | Battery level changed : Battery : 21% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:34:58 | Battery level changed : Battery : 20% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:39:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:39:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:40:58 | Battery level changed : Battery : 19% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:44:58 | Battery level changed : Battery : 18% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:44:58 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 129mb free / 146mb
    RAM Memory free: 4mb free / 23mb
    RAM Object count: 400k    (17mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 43k free / 512k   (17mb)
    =======================================================================================
    
    07/12/2010 23:46:37 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:46:51 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:48:58 | Battery level changed : Battery : 17% (temp : 34 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:54:02 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:54:16 | Network state changed : GPRS_STATE_STANDBY
    07/12/2010 23:56:58 | Battery level changed : Battery : 16% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:58:58 | Battery level changed : Battery : 15% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    07/12/2010 23:59:01 | Network state changed : GPRS_STATE_READY
    07/12/2010 23:59:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 00:02:59 | Battery level changed : Battery : 14% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:02:59 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 129mb free / 146mb
    RAM Memory free: 4mb free / 23mb
    RAM Object count: 399k    (17mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 44k free / 512k   (17mb)
    =======================================================================================
    
    08/12/2010 00:08:59 | Battery level changed : Battery : 13% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:11:01 | Global event Occured : GUID_FLASH_LOW (guid=945659952435832745 data0=0 data1=0)
    08/12/2010 00:14:02 | Network state changed : GPRS_STATE_READY
    08/12/2010 00:14:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 00:14:59 | Battery level changed : Battery : 12% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:18:59 | Battery level changed : Battery : 11% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:19:01 | Network state changed : GPRS_STATE_READY
    08/12/2010 00:19:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 00:22:59 | Battery level changed : Battery : 10% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:22:59 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 132mb free / 146mb
    RAM Memory free: 8mb free / 23mb
    RAM Object count: 216k    (13mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 228k free / 512k   (13mb)
    =======================================================================================
    
    08/12/2010 00:28:59 | Battery level changed : Battery : 9% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:29:00 | Battery Low
    08/12/2010 00:29:01 | Vibrate done  (reason 2)
    08/12/2010 00:29:04 | Vibrate done  (reason 2)
    08/12/2010 00:30:00 | Battery level changed : Battery : 8% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:33:00 | Battery status changed : BSTAT_LOW,BSTAT_NO_CAMERA_FLASH
    08/12/2010 00:33:30 | Battery level changed : Battery : 7% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:34:00 | Battery level changed : Battery : 5% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:34:00 | Battery problem!!
    =================================== MEMORY INFORMATIONS ===================================
    Runtime  Memory Free: 133mb free / 146mb
    RAM Memory free: 8mb free / 23mb
    RAM Object count: 175k    (12mb)
    Flash Total size : 118mb free / 252mb   (67k Objects)
    Object Handles : 269k free / 512k   (12mb)
    =======================================================================================
    
    08/12/2010 00:34:02 | Network state changed : GPRS_STATE_READY
    08/12/2010 00:34:17 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 00:47:02 | Battery level changed : Battery : 4% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:48:02 | Battery level changed : Battery : 3% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 00:49:04 | Network state changed : GPRS_STATE_READY
    08/12/2010 00:49:18 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 00:54:01 | Network state changed : GPRS_STATE_READY
    08/12/2010 00:54:15 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 01:09:01 | Network state changed : GPRS_STATE_READY
    08/12/2010 01:09:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 01:24:02 | Network state changed : GPRS_STATE_READY
    08/12/2010 01:24:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 01:29:01 | Network state changed : GPRS_STATE_READY
    08/12/2010 01:29:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 01:34:38 | Battery level changed : Battery : 2% (temp : 33 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 01:44:01 | Network state changed : GPRS_STATE_READY
    08/12/2010 01:44:16 | Network state changed : GPRS_STATE_STANDBY
    08/12/2010 01:50:10 | Battery level changed : Battery : 1% (temp : 34 °C) | Signal : -74dbm (cellid : 14168)
    08/12/2010 01:52:41 | Battery status changed : BSTAT_LOW,BSTAT_NO_CAMERA_FLASH,BSTAT_NO_RADIO,BSTAT_NO_WLAN
    08/12/2010 01:52:41 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=1 data1=0)
    08/12/2010 01:52:41 | Global event Occured : UNKNOWN (guid=5961289116197897667 data0=3 data1=0)
    

    My app works on a Curve 8900 with os 4.6.1.310

    My application for the battery drain did nothing more than before draining. The app has no timer and I just created a new record in RMS at 21:11 and then the battery drain started (I don't have touch the device more after that).

    Maybe I use a lot of memory but battery never drain start at the same time and memory seems OK and no different than when it does not drain the battery.

    There is no MemoryLeak because after the Garbage collector, I have the same amount of memory.

    Is there a mechanism that can work when there is problem of memory like GarbageCollector in the BONE, or maybe that's not a problem of memory, which could drain the battery like that? There is nothing strange in the event log.

    How can I get more information such as CPU, or anything else that can help me determine what is happen.

    I can't reproduce the problem when I want and not on all my devices. We have change the levels is not a battery problem.

    The device is connected to a BES and I disable memorycleaner, wifi, bluetooth, otasync, etc.

    I tried with display of genius, but I wasn't able to watch it for the battery drain...

    I am really lost and don't know what is coming...

    Please help me

    I just found the cause of the problem, this is a loop of paint on a form that contains a custom textfield who painted it is own container which repainted the textfield itself, etc.
    I solved the problem with JDE 5.0 and its view of CPU that helps me detect this problem.
    Thanks for your help!

  • How do external swf garbage collector in the Air for iOS?

    My app uses a lot of external SWF (although they are actually included in the application with a file, but they are not shipped) and does not contain any bitmapdata, only of vector graphics. The problem I have is that they seem to never be garbage collected and System. privateMemory continues to increase while the application loads more SWFs.

    As sovereign wealth funds contain vector graphics, I cancel all just all the variables that are now the reference to the SWF file and call it system.GC()... But it doesn't seem to work. What should I do for the garbage collector to clean sovereign wealth funds?

    I use Air for iOS 3.5.0.1060 and ActionScript3.0.


    Ago - I found that they are not always collected garbage when you expect to be. It is not that they are "missed" just AIR decides to wait before waste collection. I found that continuous application to run they will eventually be garbage collected at the same time very unpredictable, as long as you don't have really any remaining reference for them.

  • Garbage Collector

    Hello Nick, Mike,.

    How Garbage collection works in Disqualification in the case of the table with String objects? Especially in the script processor, we need to cancel the objects after setting the output argument? Or processor itself will be responsible for Garbage collection?

    Thank you

    Konate

    Hi konate,.

    Takes place automatically in Disqualification garbage collection and you do not need to do any 'tidy' explicit for most of the scripts. The only exception perhaps of scripts that make calls outside the JVM, for example creating a connection to external database customized to make a remote procedure call. In some of these circumstances, you can be explicitly required to close the objects to free memory. This will depend on the library/API in question.

    Kind regards

    Nick

  • (Can) sound objects must be garbage collector on mobile?

    I am trying to optimize a file for mobile and I was wondering need to garbage collect sound objects? Is this really useful? Is this possible? How would I go to do this?

    I have several scenes in my folder that are only needed during an opening scene and intro sounds.

    FYI, my understanding of garbarge collection is that a large part of it is completed by the system automatically, but some of them can be carried out manually.

    Here is the code:

    var LongAIntro:IntroSoundLongA

    var LongASoundChannel:SoundChannel

    for (var i: Number = 0; i < = 1; i ++) {}

    LongAIntro = new IntroSoundLongA();

    LongASoundChannel = LongAIntro.play ();

    }

    Flash uses the traditional reference based garbage collection. This means that if you leave any type of reference for sound in memory (as linked to a global variable, on the display list, etc.) it will remain in memory. As soon as you null to the variable reference is removed and is subject to garbage collection (when memory is required).

    After your sound is done playing just LongAIntro and LongASoundChannel = null; and it must be marked for the collection.

    And Yes, it's important. Using Flash Builder Premium you can profile the memory and it would show you all the objects in memory and how much "References" is to these objects. Allows you to know whether you have properly removed from memory.

  • How could question about crossing of directories, be in my code?

    I would like to add several files and directories to zip archive. But the question on the crossing of directories.
    Have the structure of the following files:
             directory1:
                    directory3:
                            11.txt
                            22.txt
                            33.txt
                    directory4:
                            111.txt
                            222.txt
                    directory6:
                            555.txt
                            666.txt
                    1.txt
                    2.txt
                    5.txt
    Class with the main method:
    package main;
    
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import main.zip.ZipArchiver;
    
    public class ZipTest{
        public ZipTest(){
            try{
                new ZipArchiver("directory1.zip").zip("directory1");
            }catch(FileNotFoundException ex){
                ex.printStackTrace();
            }catch(IOException ex){
                ex.printStackTrace();
            }
        }
        public static void main(String[] args){
            new ZipTest();
        }
    }
    Class ZipArchiver:
    package main.zip;
    
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    
    public class ZipArchiver{
    
        public ZipArchiver(String zfn) throws FileNotFoundException{
            zipFileName=zfn;
            fos0=new FileOutputStream(zipFileName);
            zos0=new ZipOutputStream(fos0);
    
        }
    
        public void zip(String directory) throws FileNotFoundException,IOException{
            System.err.println("Starting zip("+directory+"):");
            System.out.println("directory="+directory);
            File f0=new File(directory);
            String[] files=f0.list();
            System.out.println("files.length 1="+files.length);
            for(int j=0;j<files.length;j++){
                System.out.println("files["+j+"]="+files[j]);
            }
            for(int i=0;i<files.length;i++){
                System.out.println("files.length 2="+files.length);
                for(int j=0;j<files.length;j++){
                    System.out.println("files["+j+"]="+files[j]);
                }
                System.out.println("files["+i+"]="+files);
    ZipEntry zipEntry=null;
    if(new File(directory+fileSeparator+files[i]).isDirectory()){
    System.out.println("Adding directory: "+files[i]);
    zipEntry=new ZipEntry(files[i]+fileSeparator);
    zos0.putNextEntry(zipEntry);
    zos0.closeEntry();
    System.out.println("zip(files["+i+"].getPath())="+files[i]);
    zip(directory+fileSeparator+files[i]+fileSeparator);
    }else{
    System.out.println("Adding file: "+files[i]);
    zipEntry=new ZipEntry(files[i]);
    zos0.putNextEntry(zipEntry);
    zos0.closeEntry();
    }
    }
    }
    public final static String fileSeparator=System.getProperty("file.separator");
    private FileOutputStream fos0=null;
    private ZipOutputStream zos0=null;
    private String zipFileName=null;
    }

    To tell the truth I can’t figure out how the recursion of directories could be here?
    Here is an out:
    Starting zip(directory1):
    directory=directory1
    files.length 1=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files.length 2=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[0]=1.txt
    Adding file: 1.txt
    files.length 2=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[1]=2.txt
    Adding file: 2.txt
    files.length 2=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[2]=5.txt
    Adding file: 5.txt
    files.length 2=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[3]=directory3
    Adding directory: directory3
    zip(files[3].getPath())=directory3
    directory=directory1\directory3\
    Starting zip(directory1\directory3\):
    files.length 1=3
    files[0]=11.txt
    files[1]=22.txt
    files[2]=33.txt
    files.length 2=3
    files[0]=11.txt
    files[1]=22.txt
    files[2]=33.txt
    files[0]=11.txt
    Adding file: 11.txt
    files.length 2=3
    files[0]=11.txt
    files[1]=22.txt
    files[2]=33.txt
    files[1]=22.txt
    Adding file: 22.txt
    files.length 2=3
    files[0]=11.txt
    files[1]=22.txt
    files[2]=33.txt
    files[2]=33.txt
    Adding file: 33.txt
    files.length 2=6 *<------WHY THE LENGTH OF ARRAY files =6 AGAIN?*
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[4]=directory4
    Adding directory: directory4
    zip(files[4].getPath())=directory4
    Starting zip(directory1\directory4\):
    directory=directory1\directory4\
    files.length 1=2
    files[0]=111.txt
    files[1]=222.txt
    files.length 2=2
    files[0]=111.txt
    files[1]=222.txt
    files[0]=111.txt
    Adding file: 111.txt
    files.length 2=2
    files[0]=111.txt
    files[1]=222.txt
    files[1]=222.txt
    Adding file: 222.txt
    files.length 2=6
    files[0]=1.txt
    files[1]=2.txt
    files[2]=5.txt
    files[3]=directory3
    files[4]=directory4
    files[5]=directory6
    files[5]=directory6
    Adding directory: directory6
    zip(files[5].getPath())=directory6
    Starting zip(directory1\directory6\):
    directory=directory1\directory6\
    files.length 1=2
    files[0]=555.txt
    files[1]=666.txt
    files.length 2=2
    files[0]=555.txt
    files[1]=666.txt
    files[0]=555.txt
    Adding file: 555.txt
    files.length 2=2
    files[0]=555.txt
    files[1]=666.txt
    files[1]=666.txt
    Adding file: 666.txt

    Edited by: user124 on Oct 19, 2011 6:13 PM

    deleted
            if(directory.endsWith("directory1\\tmp")){
                zos0.close();
                fos0.close();
            }
    It's in the previous version.

    I thought that when I create a new instance of table files, more former precipitates with garbage collector automatically.

    Calling the method retains its local variables until it returns. So if there are recursive calls N of the method copies the variable N in the existence at the same time. When each of them returns, its local variables are released (to simplify).

    You can just tell me this error instead of writing of the unnecessary words (sorry if you offend).

    A ridiculous (and shocking) statement. You assume that people can read your mind to see what wrong thoughts are inside. I give you the right answer, for the third time, and you are accusing me of writing of the unnecessary words. You're the one who writes lyrics that are unnecessary here.

  • Simple questions on the earphones of events and memory management

    I am brand new to AS 3.0 (have not coded in 10 years!) and I have a two part question on the management of event listeners.

    1. is it possible to use variables or loops to simplify the process of creating event listener? For example, I have a scene that animates the leaves when they are hit. There are 25 or more leaves, so I need to handlers of 25 and 25 functions, even if the animation is the same. Right now my code looks like this:

    leaf1.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf1);
    leaf2.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf2);
    leaf3.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf3);

    etc. And then the functions all alike as well.

    function animateLeaf1(e:TouchEvent): void {}
    leaf1.gotoAndPlay ("animationStart");
    }

    function animateLeaf2(e:TouchEvent): void {}
    leaf2.gotoAndPlay ("animationStart");
    }

    etc. My instinct tells me there is an easier way to do this, but I don't know if it's just because I see a model and want to put it in a loop or if there is really a better way to do it. I have event listeners are doing right?

    2. How can I clean my waste? Each of my frames will have 100-300 earphones of events inside, for animations, etc., mainly because a single button can have 3-5 event listeners (touch Start, end touch, touch roll on, roll off touch, etc.). Is this too much for a mobile device to manage? When can I disable event listeners to make sure that they are the garbage collector to release the memory? I don't want memory leaks, but the event listeners must be active when the frame is active and destroyed when the setting is inactive; I don't know how to program which, or if such a garbage collection is already inherent in Flash.


    Thank you very much!
    Amber

    leaf1.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf2.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf3.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf4.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    function animateLeaf(e:TouchEvent): void {}
    e.currentTarget.gotoAndPlay ("animationStart");
    }

  • Related methods and the garbage collection

    Hello

    In the example, you can see that I create an instance of TestClass. In the constructor of

    TestClass I set the property to "f". As you can see there is no reference to the XClass

    instance, but is made of "foo" is extracted from the XClass instance and is stored in the 'f '.

    property.

    The question:

    The garbage collector deletes the instance memory XClass?

    I think that he cannot remove it because the bound method (which is store in 'f') refers to her (it).

    (But if I put the 'f' null the garbage collector property will remove it.)

    Can you confirm?

    Thank you

    LACITO

    The example:


    class XClass
    {
    function foo (): void / / method defined, related
    {
    ...
    }
    }

    class TestClass
    {
    protected var f: Function = null;

    public void TestClass()
    {
    f = new XClass (*.foo ());
    }
    }


    ...
    var myTest:TestClass = new TestClass();
    ...

    The answer lies in the following topic:
    http://tech.groups.Yahoo.com/group/flexcoders/message/82709

    Thank you, Gordon.

  • question of program design

    Hi, I'm working on my first blackberry and I'm running difficulties with my design decision, so I hope someone could clarify.

    Every time I have airs in .net, I would use the MVC pattern. My will would execute a custom event defined in the regulator and I think could capture this event. However, I don't know how I can do this for blackberry. I have a text in my view field and a class that extends buttonfield in the model. I would like to set the button to have some effect on the text field, but I don't know how to get the message without the screen to each button.

    How is this bit?

    Thanks for your help

    Well technically the best design is a Singleton model, but to be honest, I don't know how they actually work. It all depends on how you look at. This global semi variable are not available outside of an instance of your application, and you are not likely to have a large development on a BlackBerry app team, so the chances of your loss of its security program or stability due to the interference is low. I know that experienced programmers and professors who are religious opposition to global variables, but they certainly have their place, and I see no problem with taking advantage of this feature you are proposing. The key thing to remember for the development of BlackBerry, it is that mobile devices are not as powerful as a PC or console. Developers are encouraged to take advantage of multi-threading to maximize efficiency and avoid the garbage collection (in other words, create variables with limited scope that are released from memory. This memory must be systematically freed by the garbage collector). Another good practice is to stick to the condensed syntax (aka shortcut).

    For example:

    If (event) {/ * action * /}

    Instead of...

    If (event == true) {/ * action * /}

    Hope that helps,

    ~ Dom

  • Garbage collection

    If the garbage collector is called by an application, it works in the background or in the thread called? Is it possible to profile in the JDE memory while an application is running?

    I think that you will find this video very useful.  He explains more about the garbage and shows the determination of the characteristics.

    Garbage Collection

    http://www.BlackBerry.com/DevMediaLibrary/view.do?name=GarbageCollection

  • Question of JRockit jdk

    I am trying to install transport management transport Oracle Intelligence Fusion.

    the instructions indicate that I should go to http://commerce.bea.com/index.jsp and download the JRockit JDK 1.5 or more. Clearly these instructions have not caught up with the transition from BEA to Oracle.

    I've been to http://www.oracle.com/technology/software/products/jrockit/index.html but can't see any mention of the JDK
    Reflected on the delivery as well

    How do you get the JDK these days?

    Thank you

    The easiest way is probably to go to the [OTN download site | http://www.oracle.com/technology/software/products/jrockit/index.html] and download and install JRockit real time. The package includes the JRockit Mission Control and the JVM.

    Note 1 - JRockit Mission Control and the XGCPrio -: Determnistic of the Pavilion may require separate licenses. You are allowed to download the songs, but check your licenses before using JRMC or the garbage collector deterministic in production.

    Note 2 - we are aware that this download method of the JAVA virtual machine for use with other parts of the Oracle stack is going against the intuitive, we're working on the most obvious solution.

    / Tomas Nilsson

  • iPhoto quit unexpectedly

    Everytime I open iPhoto, it crashes within 5-10 seconds.  Below is the main of troubleshooting information it gives.  I had to remove some of these error information, the question could not be submitted successfully with the entire block of content.

    -------------------------------------------------------------------------------- --------------------------

    Process: iPhoto [11538]

    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto

    ID: com.apple.iPhoto

    Version: 9.4.3 (9.4.3)

    Generation information: iPhotoProject-720091000000000 ~ 1

    App item ID: 408981381

    The external application ID: 15017489

    Code type: X 86 (native)

    Parent process: launchd [167]

    User ID: 502

    Date/time: 2016-01-17 18:24:43.539-0500

    OS version: Mac OS X 10.8.5 (12F2560)

    Report Version: 10

    Interval since last report: 787 s

    Crashes since last report: 28

    Per-App interval since last report: sec 77

    Per-App crashes since last report: 2

    Anonymous UUID: 54C710EA-1418-B7D2-7A70-FC6751A59B7C

    Crashed thread: 0 dispatch queue: com.apple.main - wire

    Exception type: EXC_BAD_ACCESS (SIGSEGV)

    Exception codes: KERN_INVALID_ADDRESS at 0x00000000c5320a30

    VM regions near 0xc5320a30:

    CG shared images c 00000000 00000000 0001000 c 0009000 [32K] rw-/ rw - SM = SHM

    -->

    CG shared images 00000000c5b33000-00000000c5b3b000 [32K] rw-/ rw - SM = SHM

    Request for clarification:

    dyld: in dlopen()

    /System/Library/QuickTime/AppleProResDecoder.component/contents/MacOS/AppleProRe sDecoder

    Summary region VM:

    ReadOnly part of libraries: Total = 270.8 M resident=72.1M(27%) swapped_out_or_unallocated=198.7M(73%)

    Regions in writing: Total = 410. 3 m written=163.9M(40%) resident=245.8M(60%) swapped_out = 40 K (0%) unallocated=164.5M(40%)

    VIRTUAL FIELD TYPE

    ===========                      =======

    ATS (font support) 32,0 M

    CG backup stores 4248K

    Image CG 304K

    CG 1564 K raster data

    Images shared CG 1216K

    CoreAnimation 5996K

    CoreAnimation (reserved) 12K reserved VM address space (not assigned)

    CoreImage 18.8 M

    CoreServices 1824K

    Foundation 35.3 M

    IOKit 34.9 M

    JS JIT generated code 448ko

    JS VM save file 4096K

    JS garbage collector 2264K

    MALLOC 215.3 M

    Flyleaf MALLOC 48 K

    Tag memory = 240 4K

    Tag memory = 242 12K

    Tag memory = 249 156 K

    Tag memory = 35 K 2112

    OpenCL 52K

    OpenGL GLSL 1424K

    (Reserved) 128K reserved OpenGL GLSL VM address space (not assigned)

    Cache pages SQLite 1728 K

    Battery 95.3 M

    VM_ALLOCATE 19.7 M

    __DATA                             13.1M

    __DATA/__OBJC 316K

    __IMAGE 528K

    __IMPORT 20K

    __LINKEDIT 49.7 M

    6404K __OBJC

    __OBJC/__DATA 80K

    __PAGEZERO 4K

    __TEXT 221,2 M

    __UNICODE 544K

    mapped file 227,8 M

    shared memory 372ko

    ===========                      =======

    TOTAL OF 998,1 M

    In TOTAL, less space reserved VM 998,0 M

    Model: MacBookPro9 2, MBP91.00D3.B0B of BootROM, 2 processors, Intel Core i7, 2.9 GHz, 8 GB, MSC 2.2f44

    Graphics card: Intel HD Graphics integrated 4000, 4000, Intel HD graphics card, 512 MB

    Memory module: DIMM0/0 BANK, 4 GB DDR3, 1600 MHz, 0x80AD, 0x484D54333531533643465238432D50422020

    Memory module: DIMM0/1 BANK, 4 GB DDR3, 1600 MHz, 0x80AD, 0x484D54333531533643465238432D50422020

    Airport: spairport_wireless_card_type_airport_extreme (0x14E4, 0xF5), Broadcom BCM43xx 1.0 (5.106.98.100.17)

    Bluetooth: Version 6.1.7f5 15859, 3 service, 21 aircraft, 3 ports series entrants

    Network service: Wi - Fi, AirPort, en1

    Serial ATA Device: APPLE HARD HTS541075A9E682, GB 750,16 disk

    Serial ATA Device: MATSHITADVD-R UJ - 8à8

    USB device: hub_device, 0 x 8087 (Intel Corporation), 0 x 0024, 0x1a100000 / 2

    USB device: FaceTime HD camera (integrated), apple_vendor_id, 0 x 8509, 0x1a110000 / 3

    USB device: hub_device, 0 x 8087 (Intel Corporation), 0 x 0024, 0x1d100000 / 2

    USB device: hub_device, 0 x 0424 (SMSC), 0 x 2513, 0x1d180000 / 3

    USB Device: Hub BRCM20702, 0x0a5c (Broadcom Corp.), 0 x 4500, 0x1d181000 / 6

    USB device: Bluetooth USB Host Controller, apple_vendor_id, 0x821d, 0x1d181300 / 8

    USB device: Receiver IR, apple_vendor_id, 0 x 8242, 0x1d182000 / 5

    USB device: Apple keyboard / Trackpad, apple_vendor_id, 0 x 0252, 0x1d183000 / 4

    A lot of older versions of iPhoto 11 this meet right now:

    Huxly647 discovered this fix

    1 goto /Applications/iPhoto.app/Contents/Resources

    2 delete the files 'googlemap.html' and googlesearch.html

    IPhoto no longer crashes, site does not work, but it doesn't bother me too much.

  • Memory an error saving SequenceFile generated using API

    I am developing an application that creates a SequenceFile using .NET 4.0, c# (2010), Windows 7 Pro x 64, Dual Core 2 .5GHz, 3.0 GB of memory.  Using the EngineClass API, I create a complete SequenceFile based on user/file entries and then save it to disk.  When I finished, I save using SequenceFile.Save (), then release by using ReleaseSequenceFileEx().

    For smaller files, there is no problem.  For larger files, I occasionally get the following error:

    System.Runtime.InteropServices.COMException (0xFFFFBD98): out of memory.

    When the file is saved, it is ~2.8Mb.  Breaking the file is not an option.  I'm not a loop, it comes suddenly.  I tried shutting down VS2010 and restart the computer.  It is still not in line with the savings.

    I also had to incorporate the Interop Types false by orientation of NOR.  They said that it's unstable in 4.0.

    Questions

    1. is there a size limit for the file in the API Save() function?

    2. is there a work around using the Save()?

    Best regards

    Before saving the file try call:

    GC. Collect();

    GC. WaitForPendingFinalizers();

    This will force the garbage collector .NET to recover some memory it can to make room to of unmanaged code in TestStand engine to be able to save the file. Large blocks of contiguous space are necessary when saving the files. This will probably fix your problem, but there's a few things that you may want to consider which would also help.

    (1) what version of TestStand do you use?

    1 (b) what file format do you use? Binary (binary is set by default for new files created in TestStand 4.0 and higher), XML or INI?

    (2) do you have large tables numeric or Boolean in your sequence? If so you might want to consider making initially empty (if it is not really of any data you care to save time editing), then in your sequence, you can programmatically resize it to the size you need when running.

    Hope this helps,

    -Doug

  • FileConnection leak

    Hi, expert,

    I think that there are a few FileConnection flee to my code (doesn't have to call a close on this method), Marvel just to the following questions about this:

    1. If there is leak memory during the execution of the process, once the process is stopped, the operating system must be able to claim the FileConnection, right?  I think about C + c++ / C is like that, unless I'm missing sth here.

    2. I have a few leaks FileConnection every 4 hours, but my application may work for a while (several days) without any problem. If it leads to thinking that if garbage would help the BONES to recover the FileConnection as well. Are there such opportunities?

    Thanks in advance for your understanding on this.

    (1) Yes

    (2) I believe that the garbage collector would effectively close the connection when he sees, there is no valid references to the fileconnection special within the application and removes the object from memory. It is difficult to predict the exact behavior of the garbage collector, however. In most cases, the garbage collector does not clean until the system needs memory. I saw connections persist even after the reference that them has been withdrawn, so I wouldn't say that you can rely on the GC to clean your fileconnections in due course.

    Scott

Maybe you are looking for