From 2598b6c5179931c0b00f24d42ace0e2ea5c799f7 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 28 Oct 2020 10:52:30 -0700 Subject: [PATCH] Avoid caching very large files (that crash the UI and bloat traces). --- server/TracyWorker.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 9bb8b3cb..0a3d9380 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -49,6 +49,8 @@ static bool SourceFileValid( const char* fn, uint64_t olderThan ) struct stat buf; if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 ) { + // Avoid caching very large files (such as those in unity builds). + if ( buf.st_size >= 2 * 1024 * 1024 ) return false; return (uint64_t)buf.st_mtime < olderThan; } return false;