From e76d8bc6a986f6cc238f00cc7496830d5552fdaa Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 20 Nov 2011 00:34:34 +0100 Subject: [PATCH] limit mupdf to 64M memory usage mupdf is well known to have problems with rasterizing huge bitmaps. In Kindle DXG example, huge means larger than memory size which is 128Mb. Generally, getting memory usage above 100M gets kindle blocked so setting it to 64M seems like sane default. 96M might be upper resonable limit. K3 users with 256M or RAM might increase this value to 192M, but more testing is needed. For comparison, some full-page ads from Digital Linux Journal in pdf (older numbers) require 512M of RAM to render on Intel laptop! --- mupdf-64M-memory-limit.diff | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mupdf-64M-memory-limit.diff diff --git a/mupdf-64M-memory-limit.diff b/mupdf-64M-memory-limit.diff new file mode 100644 index 000000000..94db74fd6 --- /dev/null +++ b/mupdf-64M-memory-limit.diff @@ -0,0 +1,12 @@ +diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c +index 83f4652..c4d7d6a 100644 +--- a/fitz/res_pixmap.c ++++ b/fitz/res_pixmap.c +@@ -1,6 +1,6 @@ + #include "fitz.h" + +-static int fz_memory_limit = 256 << 20; ++static int fz_memory_limit = 64 << 20; // XXX dpavlin - limit memory usage to 64M + static int fz_memory_used = 0; + + fz_pixmap *