# Question about garbage collection / memory leak

**URL:** <https://forum.kirupa.com/t/question-about-garbage-collection-memory-leak/330258>\
**Category:** flash\
**Created:** [December 20, 2012, 6:15am UTC](https://forum.kirupa.com/t/question-about-garbage-collection-memory-leak/330258 "2012-12-20T06:15:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashdaddy](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@flashdaddy](https://forum.kirupa.com/u/flashdaddy)\
**Post date:** [December 20, 2012, 6:15am UTC](https://forum.kirupa.com/t/question-about-garbage-collection-memory-leak/330258/1 "2012-12-20T06:15:57Z")

</div>

Hey All,  
I have an issue with something and I’m trying to figure out if it’s relative to a garbage collection issue or a memory leak. I have a video that plays and then a class is called when the video plays. If I run a trace in the class, the first time the video plays, i will see:

```auto
trace("checking");

```

when the video ends, and the next video plays, I’ll see

```auto

trace("checking");
trace("checking");

```

… and it will continue to increment by 1 each time a new video is played.

Another strange thing that happens is, i can trace a random number using the Math.random() function. Let’s just say that random number comes up to 768 well, the first time the video runs, I will see:

```auto

trace("random", Math.random()) //let's just say it came out to 768

```

on the next run i’d see

```auto

trace("random", 768) //let's just say it came out to 768
trace("random", Math.random()) //let's just say it came out to 567

```

and that pattern will continue to happen. Now, at the end of the video, I do clear the class that I call by calling

```auto
someClass = null

```

so that I can load a new video but i wanted to ask, what does this issue sound like? Is this an issue with garbage collection? Has anyone ever ran into this?
