# Garbage collection question

**URL:** <https://forum.kirupa.com/t/garbage-collection-question/283355>\
**Category:** flash\
**Created:** [March 5, 2009, 7:17am UTC](https://forum.kirupa.com/t/garbage-collection-question/283355 "2009-03-05T07:17:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![awflasher](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/awflasher/32/3562_2.png) [@awflasher](https://forum.kirupa.com/u/awflasher)\
**Post date:** [March 5, 2009, 7:17am UTC](https://forum.kirupa.com/t/garbage-collection-question/283355/1 "2009-03-05T07:17:03Z")

</div>

Hi all,

Today I found it very strange that even I use the popular “LocalConnection” hack, the memory is still not released AT ONCE! (It’s hold for 2-5 seconds)

I **even put the hack code in a “EnterFrame” event** handler like this:

[COLOR=“Red”]FYI: My FPS is set at 30 and a FPS counter told me everything works fine, the CPU usage is also very low.[/COLOR]

```auto
public function enterFrameHandler(event:Event):void {
  // Force GC
  try { 
    var lc1:LocalConnection = new LocalConnection(); 
    var lc2:LocalConnection = new LocalConnection(); 
    lc1.connect('name'); 
    lc2.connect('name2'); 
  } catch (error:Error) { 
}

```

With such a tough push, the flashplayer still holds its memory load for 2-5 seconds before releasing!

So… is there any rule or hacks beyond the “LocalConnection” hack? Any suggestion for me?

Thanks very much
