cd /news/artificial-intelligence/squeezing-every-megabyte-optimizing-… · home topics artificial-intelligence article
[ARTICLE · art-58126] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Squeezing Every Megabyte: Optimizing an 8GB NVIDIA Jetson Orin Nano for Headless ROS 2 and Edge-AI

An engineer optimized an 8GB NVIDIA Jetson Orin Nano for headless ROS 2 and edge-AI by disabling the graphical desktop and unnecessary services, reducing idle RAM usage from 913 MiB to 699 MiB. The optimization included setting the system to boot to a text-only target, disabling daemons like Bluetooth and Samba, and lowering swappiness to minimize swap usage. The approach provides a foundation for running AI models and ROS 2 navigation on resource-constrained autonomous robots.

read4 min views1 publishedJul 14, 2026

When building an autonomous robot, compute efficiency is everything. If you are running on an NVIDIA Jetson Orin Nano (8GB), you are dealing with Unified Memory (UMA)—meaning your CPU and GPU share the exact same physical RAM pool.

Out of the box, JetPack 7.2 running Ubuntu 24.04 LTS boots a full GNOME graphical desktop that devours 1.5 GB to 2.0 GB of RAM just idling. If you are an Edge-AI model (like Gemma 2B), running dual IMX219 CSI cameras, processing 2D LiDAR data, and running a ROS 2 navigation stack, that desktop environment is a luxury you cannot afford.

In this guide, we will walk through a complete, step-by-step engineering log to:

When working on a mobile robot, you rarely want an HDMI monitor dangling off your vehicle. Connecting to your Jetson headlessly over a direct Ethernet link or the USB-C device port is the gold standard.

Ubuntu uses the Avahi mDNS stack. Instead of searching for IP leases in your router's client list, you can connect directly using your Jetson's hostname:

ssh username@your-jetson-hostname.local

Tip: If you are connecting via a direct Ethernet cable between your laptop and the Jetson, ensure your laptop's Ethernet interface is set to "Link-Local Only" or "Share to other computers" to auto-assign compatible IP addresses.

Let's look at the actual optimization path. Our starting point on a fresh, graphical JetPack 7.2 installation was 913 MiB of active RAM usage (with no monitor attached, using SSH). We want to bring this down as low as possible.

The single biggest RAM culprit is the graphical environment. Since our robot is autonomous and headless, we can safely instruct systemd to boot directly to a text-only target.

sudo systemctl set-default multi-user.target

sudo systemctl isolate multi-user.target

Result: Idle memory drops instantly from 913 MiB to 699 MiB, saving over 200 MiB.

Even in headless mode, standard desktop Ubuntu environments run helper programs, network daemons, and background profiling tools that are completely useless on an embedded robot.

Let's list running services:

systemctl list-units --type=service --state=running

Based on this analysis, we can safely disable several heavy-hitting daemons.

lttng-sessiond.service

iperf3.service

smbd.service

& nmbd.service

kerneloops.service

bluetooth.service

Disable them all in one command:

sudo systemctl disable --now lttng-sessiond.service iperf3.service smbd.service nmbd.service kerneloops.service bluetooth.service

nvargus-daemon.service

nvfancontrol.service

jtop.service

jetson-stats

—virtually zero footprint, but indispensable for system profiling.Because the Jetson uses flash storage (like an NVMe SSD), aggressive swapping can wear down your drive and introduce latency. By default, Linux has a high "swappiness" value (60

), meaning it starts swapping idle memory pages early.

We want to lower this value to 10

, telling the kernel to swap only as an absolute last resort:

sudo sysctl vm.swappiness=10

echo "vm.swappiness=10" | sudo tee -a /etc/etc/sysctl.conf

Additionally, you can manually drop inactive system file caches to clear up immediate memory blocks right before high-impact AI pipelines:

sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'

With our OS footprint optimized, we now have a perfect foundation for ROS 2 Jazzy Jalisco (the Tier-1 supported LTS release for Ubuntu 24.04).

Since we are running a headless robot, we will opt for the ros-base

package installation. This avoids bringing back any desktop GUI tools (like RViz or rqt) which would pull in hundreds of megabytes of heavy X11/Qt visual dependencies.

sudo apt update && sudo apt install locales -y
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

sudo apt install software-properties-common -y
sudo add-apt-repository universe -y

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt install ros-jazzy-ros-base ros-dev-tools -y

To make the ROS 2 tools available automatically every time you log in via SSH:

echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
source ~/.bashrc

Verify your installation:

ros2 --help

With all of these steps completed, let's look at our final memory profile:

mdshaifur@shaifur-orin-nano:~$ free -h
               total        used        free      shared  buff/cache   available
Mem:           7.4Gi       607Mi       6.2Gi        12Mi       817Mi       6.8Gi
Swap:           15Gi          0B        15Gi

By transitioning to headless mode and optimizing background services, our baseline memory plummeted to an astonishing 607 MiB!

This leaves you with 6.8 GiB of fully available, ultra-fast unified memory. You are now in the perfect position to safely run:

llama.cpp

using ~1.5–2 GB of VRAM on the Jetson's GPU.Optimizing your hardware limits isn't just about resource conservation—it is what makes robust, low-latency, and reliable edge robotics possible!

Have you optimized your Jetson platform for edge-AI or robotics? Let me know your favorite tricks in the comments below!

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @nvidia jetson orin nano 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/squeezing-every-mega…] indexed:0 read:4min 2026-07-14 ·