<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Memory on RawCull</title><link>https://techrawcull.netlify.app/tags/memory/</link><description>Recent content in Memory on RawCull</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 30 Jul 2026 07:59:27 +0200</lastBuildDate><atom:link href="https://techrawcull.netlify.app/tags/memory/index.xml" rel="self" type="application/rss+xml"/><item><title>Memory Cache</title><link>https://techrawcull.netlify.app/docs/cache/</link><pubDate>Tue, 19 May 2026 00:00:00 +0000</pubDate><guid>https://techrawcull.netlify.app/docs/cache/</guid><description>&lt;h1 id="cache-system"&gt;Cache System&lt;a class="td-heading-self-link" href="#cache-system" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;RawCull uses several caches because RAW decoding is expensive and because different UI surfaces need different image sizes. The normal thumbnail path is layered RAM -&amp;gt; disk -&amp;gt; RAW extraction. The zoom path has its own disk cache for larger embedded JPEGs. Burst analysis has a separate JSON cache for derived analysis data.&lt;/p&gt;
&lt;h2 id="source-map"&gt;Source Map&lt;a class="td-heading-self-link" href="#source-map" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Cache&lt;/th&gt;
					&lt;th&gt;Main files&lt;/th&gt;
					&lt;th&gt;Stores&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;Preview memory cache&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Actors/SharedMemoryCache.swift&lt;/code&gt;, &lt;code&gt;Model/Cache/CachedThumbnail.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Larger &lt;code&gt;NSImage&lt;/code&gt; thumbnails for detail/loupe use&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Grid memory cache&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Actors/SharedMemoryCache.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Small grid thumbnails, downscaled before insertion&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Thumbnail disk cache&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Actors/DiskCacheManager.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;JPEG thumbnail files under the app cache directory&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Full-size JPEG disk cache&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Actors/FullSizeJPGDiskCache.swift&lt;/code&gt;, &lt;code&gt;Model/Handlers/ZoomPreviewHandler.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Larger embedded JPEG previews for zoom&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Burst analysis cache&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Actors/BurstAnalysisCache.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;JSON snapshots of embeddings, scores, groups, rankings, and review state&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Diagnostics&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;Model/Cache/CacheDelegate.swift&lt;/code&gt;, &lt;code&gt;Model/Cache/CacheStatistics.swift&lt;/code&gt;, &lt;code&gt;Views/Diagnostics/MemoryDiagnosticsView.swift&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Hit/miss/eviction/pressure counters&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="thumbnail-lookup"&gt;Thumbnail Lookup&lt;a class="td-heading-self-link" href="#thumbnail-lookup" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;pre class="mermaid"&gt;flowchart TD
 A[&amp;#34;Request thumbnail&amp;#34;] --&amp;gt; B{&amp;#34;Preview memory cache?&amp;#34;}
 B --&amp;gt;|&amp;#34;hit&amp;#34;| C[&amp;#34;Return NSImage&amp;#34;]
 B --&amp;gt;|&amp;#34;miss&amp;#34;| D{&amp;#34;Disk thumbnail cache?&amp;#34;}
 D --&amp;gt;|&amp;#34;hit&amp;#34;| E[&amp;#34;Decode JPEG and refill memory&amp;#34;]
 D --&amp;gt;|&amp;#34;miss&amp;#34;| F[&amp;#34;RawParserKit extractThumbnail&amp;#34;]
 F --&amp;gt; G[&amp;#34;Create NSImage&amp;#34;]
 G --&amp;gt; H[&amp;#34;Store preview memory&amp;#34;]
 G --&amp;gt; I[&amp;#34;Store grid memory copy&amp;#34;]
 G --&amp;gt; J[&amp;#34;Save disk JPEG&amp;#34;]&lt;/pre&gt;
&lt;p&gt;The same lookup idea is used by preload and on-demand requests. &lt;code&gt;ScanAndCreateThumbnails&lt;/code&gt; warms the cache after a catalog opens. &lt;code&gt;ThumbnailLoader&lt;/code&gt; and &lt;code&gt;RequestThumbnail&lt;/code&gt; resolve individual thumbnails while the user scrolls.&lt;/p&gt;</description></item></channel></rss>