Torizon on apalis-imx6 with high memory usage and large storage space

Hi, we are just testing Torizon OS (TorizonCore Upstream 6.7.0+build.18) on an apalis-imx6 with 1GB Ram and 4GB flash.

We are using VS Code with the Torizon templates. The memroy usage seems high and the need for storage space alos seem tob e very lagre. For example if we are running only the Torizon Image on the device, the meory usage is at approx 40% (400MB). If the the Docker service is deactivatet, it is still at 30%. Also the sorage usage is araund 30%.

If we are now using for example the Avalonia template and create a very small application. Now the memory usage is up to 65% (650mb) and over 2GB of storage space is occupied. Which seems both very high. We also tested the templates for UNO (no Debugging for imx6!?) and Qt with alsmost the same effects.

Are these values normal? Are there optimizations possible?

We already read Memory usage of Torizon OS - Technical Support - Toradex Community,
but changing the CMA had minimal ton o impact.

We fear problems with the memory, even if we use the larger version. Which is also a cost issue. We had no problems with this on the WinCE boards.

Best Regards,
Michael

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, the memory and storage usage you are observing with Torizon OS on the Apalis iMX6 does seem to be on the higher side, especially when compared to your previous experience with WinCE boards. Here are a few points and potential optimizations to consider:

  1. Base Memory Usage: The base memory usage of 40% (400MB) for Torizon OS is relatively typical, as Torizon is a full Linux-based OS with additional services and features that naturally consume more resources than a more minimal OS like WinCE.

  2. Docker Overhead: Docker does introduce some overhead, which is why you see a reduction in memory usage when Docker is deactivated. However, Docker is integral to Torizon’s functionality, so completely removing it may not be feasible.

  3. Avalonia and Other Templates: The increase in memory and storage usage when using the Avalonia template or other similar templates is expected due to the additional libraries and runtime environments required by these frameworks. Avalonia, being a cross-platform UI framework, can be resource-intensive.

  4. Optimizations:

    • Minimize Running Services: Review and disable any unnecessary services or containers that may be running by default.
    • Optimize Docker Images: Ensure that your Docker images are as lean as possible. Remove unnecessary packages and dependencies.
    • Use Lightweight Frameworks: If possible, consider using more lightweight frameworks or libraries that better fit the resource constraints of your hardware.
    • Memory Management: While you mentioned that changing the CMA settings had minimal impact, continue to explore other kernel parameters or memory management techniques that might help.
  5. Hardware Considerations: If resource constraints continue to be a significant issue, you may need to consider hardware with more RAM and storage, despite the cost implications.

Ultimately, while some of the resource usage is inherent to the nature of Torizon and the frameworks being used, careful optimization of your applications and system configuration can help mitigate these issues.

Please, also check if these links can help you solve your problem:

Getting started for Torizon and Apalis iMX6 fails to build container.

Hello @mimeyer,

The memory usage you see is normal for Torizon OS.
For most applications this is not a problem.

However, it is always important to keep an eye on it and make sure that your application can run without issues.
There are optimizations that can be done on the container and application side to reduce the memory consumption.
One example that may be possible, depending on your GUI framework of choice, is to not use the Weston compositor container, instead opting to output directly to DRM.

Regarding the storage usage, when developing with the extension it is expected to be disproportionately high.
The reason for this is that during development a debug container is used, which includes debug symbols and libraries, increasing a lot the final size of the container.
When you generate a production image through the extension, it should be considerably smaller, and you should be able to further optimize its size by not adding unused packages and much more.
Optimizing containers for size is something that can be done in many different ways, so if needed there is usually a lot of room for improvement.

Do you have some idea of how much your application may require in terms of free memory and storage?

Best Regards,
Bruno