Jump to content
C4 Forums | Control4

How to manage memory in a Control4 controller.


Recommended Posts


I am programming with Composer in HC300.

Sometimes, I face the frozen screen and I did not know how to fix it.

Just reboot the controller and I found that it started to work again.

Recentely, I checked the resource of the controller box.


Total memory : Used Memory Free

252,424 K 193,708K 58,716

However, free memory size has decreased without any serious workload as below.


Time Free Memory space ( K )


02:00 58,716

02:15 53,356

03:00 48,656

03:05 46,564

03:20 45,140

I heard that Lua language has gabage colletion facility to manage memory.

If you have any tips how to manage memory, please let me know.

Link to comment
Share on other sites

However, free memory size has decreased without any serious workload as below.

I don't know specifics of the HC300 but it runs Linux and as a rule in Linux/Unix, you shouldn't worry about the "free" memory value. Free memory is simply memory that does not hold any valid pages. It typically will be a very low number and will decrease over time after a reboot as applications are activated.

When an application terminates, the memory it had allocated is not necessarily moved back to the "free" pool. Much of it remains allocated and is merely moved to the "cached" category in Linux. (Unix marks it as "inactive"). The code or data that it held remains in memory in case the application is reloaded and needs it again. That's faster than re-loading it all from disk. Should a different application need that memory space, the previous application's data is overwritten with the new one's.

What you really care about is the paging rate, not the free memory value.

Here's a pretty good explanation.


Edit: A more detailed explanation:


You will find most of the commands referenced are missing from the stripped down Linux in the HC300. I think you'll also see that your swap (and thus paging) is always zero -- this is probably deliberate because it runs from flash, not a hard drive. Most embedded (flash-based) Linux/Unix versions disable swapping so they don't kill the flash with constant writes.

All of that doesn't mean you don't have a constantly running application with a memory leak that's eating up your memory, but it's unlikely

Link to comment
Share on other sites

Thank you for your explanation in detail.

I become to know the basic structure of memory management in Linux.

My goal is to install JRE in Busybox.

But, I don't have any reference or guide to do it.

( I have googled for three days. )

It would be very helpful if you give me useful advice.

Link to comment
Share on other sites

I had no idea what he was saying and I figured you'd come back with two pages of pros/cons.

No, thank you!! That was my first big laugh of the day!

I can sometimes be short and sweet with my answers. But it's definitely my nature to run on and on trying to cover every possible aspect. Not only that, but blah, blah, blah..... And, oh yeah, there's ....

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...