# Strange memory behaviour

**URL:** <https://forums.openmv.io/t/strange-memory-behaviour/2056>\
**Category:** OpenMV Boards\
**Created:** [December 8, 2020, 6:55am UTC](https://forums.openmv.io/t/strange-memory-behaviour/2056 "2020-12-08T06:55:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kabron](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kabron/32/1557_2.png) [@Kabron](https://forums.openmv.io/u/Kabron)\
**Post date:** [December 8, 2020, 6:55am UTC](https://forums.openmv.io/t/strange-memory-behaviour/2056/1 "2020-12-08T06:55:23Z")

</div>

Simple code:

```python
import sensor, image, lcd, time, gc

gc.enable()
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA2) # Special 128x160 framesize for LCD Shield.
sensor.skip_frames(time = 2000)
lcd.init() # Initialize the lcd screen.

clock = time.clock()
while(True):
    clock.tick()
    img = sensor.snapshot()
    lcd.display(img)
    print("FPS=%2.2f, Free=%d" %(clock.fps(), gc.mem_free()))

```

Free memory changes sawtooth like.  
Is it normal?

 ![Free.jpg](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/2/2b2d574e8dc66936cd7e51a0df7fc37825f8f534.jpeg)

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [December 8, 2020, 2:05pm UTC](https://forums.openmv.io/t/strange-memory-behaviour/2056/2 "2020-12-08T14:05:46Z")

</div>

Yes, it gets collected when there’s no free memory.
