Can RAM be unloaded and over-written?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
repkid
Posts: 2
Joined: Tue May 10, 2016 10:31 am

Can RAM be unloaded and over-written?

Post by repkid » Tue May 10, 2016 10:45 am

Basically I am making an .xml interpreter to load objects from an SD card onto a screen. This will eat RAM of course so I was wondering whether I can prevent a fragmented heap resulting in a memory overflow?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Can RAM be unloaded and over-written?

Post by Roberthh » Tue May 10, 2016 12:39 pm

My experience about that, from a users view:
As soon as you do not need an object any more, it can be freed by garbage collection.
- used gc.collect() frequently to manually perform a garbage collection.
- avoid a high number of tiny and very big data objects. The latter may be hard to allocate, if the memory is fragmented.

repkid
Posts: 2
Joined: Tue May 10, 2016 10:31 am

Re: Can RAM be unloaded and over-written?

Post by repkid » Wed May 11, 2016 8:51 am

Thanks for the reply.

Post Reply