====== Optimizing to Reduce RAM and Storage Utilization ====== ===== Reducing RAM Consumption ===== The latest Bullseye OS will typically consume about 300MB of RAM, at idle, after booting to the desktop. If running high memory consumption application like the Chromium browser, that could quickly rise to 600MB or more, depending on the solution. To provide a convenient out-of-the-box experience for ANY user, the ComfilePi OS includes many software packages that are likely not ALL needed by most users. Therefore, users are encouraged to remove those software packages that are not necessary for their solution. Following the procedures below, it is possible for a system to boot consuming only about 150MB of RAM. ==== Removing Software Packages ==== Here we provide a removal procedure for software packages that most users will likely not needed. Users are encouraged to follow this removal procedure for any software package they deem unnecessary for their solution. * ibus input method editor (IME) - The ibus input method editor is provided users of any language or culture can enter text in their native language. If a solution's target will only ever enter text using Roman characters, ibus can likely be removed. * Run ''sudo apt purge ibus*'' followed by ''sudo apt autoremove'' to remove ibus. * Printer support - Printer support is likely not need by must industrial automation solutions, and can likely be removed. * Run ''sudo apt purge cups*'' followed by ''sudo apt autoremove'' to remove the cups printer service. * Modem Manager - Run ''sudo apt purge modemmanager'' followed by ''sudo apt autoremove''. * Avahi Daemon - Run ''sudo apt purge avahi-daemon'' followed by ''sudo apt autoremove''. * triggerhappy - Run ''sudo apt purge triggerhappy'' followed by ''sudo apt autoremove''. * Audio - If you don't need audio, you can remove pulseaudio and pipewire. * Run ''sudo apt purge pulseaudio* pipewire*'' followed by ''sudo apt autoremove''. ==== Autostart Without the Desktop ==== If you are autostarting a fullscreen application at boot time, you likely won't need to run the desktop shell. Open ///etc/xdg/lxsession/LXDE-pi/autostart// and comment out the lines beginning with ''@lxpanel'' and ''@pcmanfm'' by prepending a ''#'' in front of them. Without the desktop, you will also likely not need the Gnome Virtual File System (gvfs). To remove that, run ''sudo apt purge gvfs*'' followed by ''sudo apt autoremove''. ==== Purchasing More RAM ==== If your solution still requires more memory, please consider a [[https://comfiletech.com/raspberry-pi-panel-pc/cpi-c070wr4c-7-industrial-raspberry-pi-touch-panel-pc-with-cm4/|CPi-C panel PC]], which is available with 2GB of RAM, or purchasing a [[https://comfiletech.com/linux-panel-pc/|CPi-S panel PC]] with the 4GB RAM option. It may be possible to purchase other variants such as 2GB or 8GB, but please inquire, as minimum order quantity (MOQ) or additional lead time may apply. See [[https://www.raspberrypi.com/news/new-memory-variants-for-the-raspberry-pi-compute-module-family/|Compute Module 4S 2GB, 4GB, or 8GB RAM options]] ===== Reducing Disk Consumption ===== The ComfilePi OS will typically consume about 6GB of storage space. Like with RAM, we aim to provide a convenient out-of-the-box experience for ANY user, but most users will not require ALL the software installed in the OS. Users are encouraged to remove the software packages they don't need. Typically, that can be done by running ''sudo apt purge {package_name}'' followed by ''sudo apt autoremove''. Removing the packages mentioned in the previous section to reduce RAM consumption will also help reduce storage consumption, but it is possible to reduce further. ==== Removing .NET ==== As we have many customers that develop their solutions in [[comfilepi:dotnet:index|C# and .NET]], we provide the mono framework (for .NET Framework 4 solutions), and the .NET SDK (for .NET 5+ solutions) installed out-of-the-box. If your solution does not require .NET, a significant amount of disk space can be saved by removing it. The mono framework is installed from the Mono project's repository, and can be removed by running ''sudo apt purge mono-complete'' followed by ''sudo apt autoremove''. On Bookworm, the .NET SDK or Runtime is installed from our package repository. To remove it run ''sudo apt purge cpi-dotnet*''. On Bullseye and earlier, the .NET SDK is [[:comfilepi:dotnet_core_development#install_the_net_sdk_on_a_development_pc|manually installed]], so it must be manually removed. Simply run ''sudo rm -rf /opt/Microsoft/dotnet'' to remove it.