Offline dictionary apps on Android generally do not load the entire dictionary into RAM. They keep the full word list and definitions on internal storage in a compact or indexed database file and map small pieces of it into memory as the user looks things up. Memory use stays modest because Android treats the stored file as backing storage and pages in only the records currently needed.

The question is worth taking literally, because the answer explains why a 200 MB dictionary can run comfortably on a phone with 4 GB of RAM, and why poorly built dictionary apps still stutter or get killed in the background. A dictionary is a special kind of data: huge, read-mostly, and accessed through exact lookups far more often than through sequential reading.

Android and the underlying Linux kernel offer several mechanisms that fit that access pattern well.

Why a full dictionary never needs to sit in RAM

A RAM copy is unnecessary because the dictionary file persists on flash storage and the operating system can read from it on demand. Loading a 100–500 MB dictionary wholesale would consume a large fraction of a mid-range phone's memory, invite the low-memory killer to terminate the app, and slow startup while the file is read. None of that is required for a lookup that touches a handful of entries.

The key idea is that memory and storage form a hierarchy managed by the kernel. File contents live in a page cache: the kernel keeps recently read portions of a file in otherwise free RAM, and discards clean pages when memory is needed, re-reading them later if asked again. An app that memory-maps or reads a file therefore gets caching for free, without ever owning the whole dataset.

For a dictionary, where a small set of common words is looked up repeatedly and most entries are touched rarely, this behaves close to an ideal cache.

Memory mapping the dictionary file

Memory mapping is the most common way serious dictionary apps make a large file feel resident without being resident. The app opens the dictionary file and asks the kernel to map it into the process's address space, typically through mmap (exposed in Android through MappedByteBuffer from FileChannel.map or through native code).

No bulk copy happens at map time; the mapping is a promise that reads from a range of virtual addresses will be served from the file.

When the app reads a mapped byte, the kernel faults in the containing page — commonly 4 KB on Android devices — from storage or from the page cache. Pages already cached cost almost nothing; pages not cached cause a single read. The operating system can evict clean mapped pages at any time under pressure, because the file on disk is the authoritative copy.

That eviction is invisible to the app: touching an evicted page simply faults it back in.

Three consequences matter in practice:

  • Startup is fast. Mapping a file is an address-space operation, not a data copy, so an app can be ready to search before the dictionary has been physically read.
  • Memory accounting is honest. Mapped file pages count as reclaimable, so Android is more willing to keep the app alive than if it held hundreds of megabytes of private heap.
  • Random access is cheap. Jumping to an arbitrary byte offset in the mapped file — which is exactly what an index-driven lookup does — costs one page fault at most rather than a seek-and-read sequence the app must orchestrate.

The main constraints are architectural. A MappedByteBuffer is limited to 2 GB per mapping on Android, which is far beyond any real dictionary but relevant if an app maps a whole bundle of resources in one go. Mappings also occupy virtual address space, which is plentiful on 64-bit devices but tighter on 32-bit ones.

And on Android, unmapping is not explicit: a mapping is released when the buffer is garbage-collected, so apps that repeatedly map and drop large regions can see delayed reclamation.

Building the lookup index

A dictionary without an index forces either a linear scan or an in-memory hash of every headword — and the latter is precisely the "large dictionary in memory" approach that wastes RAM. Real dictionary apps instead store a compact on-disk index alongside the definitions and binary-search it, or map it and search in place. Two structures dominate.

A sorted offset table. The index is a sorted array of records, each containing a headword (or a prefix of it) and the byte offset and length of its definition in the data file. Because it is sorted, a lookup is a binary search: about 20 comparisons for a million entries, each comparison reading one small record by offset.

The index can itself be memory-mapped, so only the pages touched by the search are faulted in — typically a few pages near the middle of the file, not the whole table.

A prefix or hash index for fast paths. For instant "search as you type" suggestions, apps often keep a much smaller auxiliary index: headword prefixes or hashes stored in a memory-mapped table or a compact on-disk B-tree. A hash table on disk gives near-constant-time exact lookup but poor range behavior; a B-tree gives both exact and prefix-ordered results. SQLite, discussed below, is the ready-made version of the B-tree approach.

The storage format matters for how well this works. Definitions are usually stored front-coded or block-compressed: headwords that share prefixes store only their distinguishing suffix, and blocks of definitions are compressed with a lightweight codec.

Front coding shrinks the index considerably because consecutive sorted headwords overlap heavily; block compression shrinks the data file and, as a side effect, means a single definition lookup reads one small compressed block rather than trading many tiny reads. The cost is decompression work, which is trivial next to the storage and memory savings.

SQLite and FTS: the database-backed route

Many Android dictionary apps use SQLite, and the reason is that SQLite is already a memory-mapped-capable, page-managed on-disk store that ships with the platform. The dictionary lives in a database file; the app queries it with indexed lookups; SQLite's own page cache in RAM holds recently used pages and is sized independently of the database. A multi-hundred-megabyte dictionary database therefore occupies only its working set in memory.

Two SQLite features are especially relevant:

  • Full-text search (FTS4/FTS5). An FTS table stores an inverted index of terms mapped to the rows containing them, which turns "find entries whose definitions mention this word" into an indexed lookup rather than a scan. This is how dictionary apps offer full-text search across definitions without loading all definitions into RAM.
  • The page cache and memory-mapped I/O. SQLite caches database pages and, when configured, can map the database file directly. Even without mapping, its cache size is a bounded, tunable number — a few megabytes by default — not the size of the file.

The trade-off is overhead. A relational database adds per-row metadata and B-tree bookkeeping that a hand-rolled sorted offset table avoids, so a raw binary format can be smaller and slightly faster for pure headword lookup. SQLite wins on development effort, transaction safety, query flexibility, and the ability to update one entry without rewriting the file. For a dictionary with rich search needs, that is usually the right trade.

Compressed and chunked binary formats

When apps want minimal storage and fast headword lookup, they adopt a custom binary layout. A representative design stores three regions in one file: a front-coded sorted headword index, a block-compressed definitions area, and a small header pointing to both. Lookup proceeds in fixed stages.

  1. Binary-search the mapped index for the headword, reading a few small records per comparison.
  2. Read the offset and compressed length of the matching definition block.
  3. Decompress that one block and extract the definition.

Each step touches a bounded number of pages, so memory use is proportional to the block size, not the dictionary size. Block sizes are chosen as a balance: larger blocks compress better and amortize reads, smaller blocks waste less decompression on a single lookup. A common range is a few kilobytes to a few tens of kilobytes per block.

A variant many apps use is the concatenated text plus offsets layout, often called a star or flat-file dictionary: one long data file of definitions and a parallel index giving each entry's start offset. Since offsets are fixed-width integers, the index can be binary-searched in place, and the data file is read one definition at a time through a mapped buffer or a positioned read.

The index stays small — roughly four to eight bytes per entry, so a million-word dictionary needs only 4–8 MB of index even before compression — and it too is usually mapped rather than loaded.

What actually stays in RAM

The resident memory of a well-built offline dictionary is a small working set, not the dictionary. Typical components include:

  • The process's own heap for the UI, the current search state, and a modest cache of recently viewed definitions.
  • The page cache and mapped pages the kernel chooses to retain, which grow opportunistically up to available memory but are reclaimable.
  • SQLite's page cache, if a database is used, bounded by configuration.
  • Small in-memory structures such as an alphabet jump table or a recently-searched-words list.

For a large dictionary, this working set is typically far smaller than the file — on the order of a few megabytes to a few tens of megabytes of genuinely resident data at any moment, with the rest of the file resident in cache only when memory is free.

The exact figure depends on block sizes, index layout, the size of the visible results list, and how the app's cache is configured; it is not a fixed number tied to the dictionary's total size.

Trade-offs across storage strategies

The table summarizes how the main strategies compare on the criteria that decide dictionary performance and memory behavior.

Strategy Lookup speed RAM working set Storage overhead Best fit
Whole dictionary loaded into heap Fast after load Large, grows with dictionary None beyond in-memory format Tiny glossaries, not real dictionaries
Memory-mapped raw file, in-place binary search Fast, one fault per page touched Small, reclaimable Minimal Large single-file dictionaries
Custom chunked + compressed binary Fast for headword lookup Small, block-sized Low Storage-constrained apps, no rich search
SQLite database Fast with indexes Bounded page cache Moderate Apps needing updates and flexible queries
SQLite with full-text index Fast exact and full-text Bounded, slightly larger cache Higher (inverted index) Definition-wide search and rich results

A whole-heap load is the approach the question imagines, and it is the one to avoid as soon as the dictionary is large. The other four all rely on the same principle: keep the bulk of the data on storage, map or page it in as needed, and let the kernel's page cache handle the hot set.

Practical checks when a dictionary app feels heavy

Symptom-driven diagnosis is faster than reading the app's documentation. If an offline dictionary starts slowly, the likely causes are eager loading — parsing the entire index or all definitions into heap at startup — or a background job that rewrites the file at launch.

If it becomes sluggish as the system gets busy, the app may be holding large private caches that compete with other apps; check its memory usage in the system's app info against its storage size.

If searches return instantly for exact words but take a perceptible pause for full-text queries, the app probably uses a headword index for the fast path and scans or queries an FTS structure for the slow path.

If a dictionary works with the network off but returns results noticeably slower right after installation and then speeds up, that is consistent with page-cache warming after the first touches of a mapped file. None of these behaviors is a defect by itself; they reflect which storage strategy the app chose.

For users comparing dictionary apps, the useful question is not "how big is the dictionary" but "how large is the app's memory footprint relative to its dictionary size." An app whose resident memory is a small fraction of the dictionary it offers is almost certainly mapping or paging its data rather than loading it, which is the design that scales.

The bottom line for Android storage

Large dictionaries on Android are stored on flash and accessed through indexing, memory mapping, and page-level caching rather than by being resident in RAM. Whether the app uses a memory-mapped binary file, a custom chunked format, or an SQLite database, the dictionary's size sets storage requirements and worst-case cold-read latency, not typical memory use.

Apps that load everything into the heap are the exception among serious dictionary apps, and they are the ones that turn a large dictionary into a memory problem.