Kaydet (Commit) dbdacc73 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Be honest about the maximum cache size

Implementation uses a multiplicator of ten. I guess the intention
here was that to calculate cache size based on the size of the inserted
images and not based on the real memory usage (potentionally more
instances of one image), which seems a bad idea because it covers the
real memory usage from the users (who will be suprised when LO's memory
usage increases tenfold of the set value).

It seems better to use the exact value in the implementation and increase
the default value on the user interface instead.

Change-Id: Ie3c0568d3518922d3a9931f894eebb9e7e5515ed
üst 7dcfafc7
...@@ -1466,7 +1466,7 @@ ...@@ -1466,7 +1466,7 @@
objects.</desc> objects.</desc>
<label>Total Graphic Cache Size</label> <label>Total Graphic Cache Size</label>
</info> </info>
<value>22000000</value> <value>220000000</value>
</prop> </prop>
<prop oor:name="ObjectCacheSize" oor:type="xs:int" oor:nillable="false"> <prop oor:name="ObjectCacheSize" oor:type="xs:int" oor:nillable="false">
<info> <info>
......
...@@ -200,11 +200,7 @@ namespace ...@@ -200,11 +200,7 @@ namespace
void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGraphicToIgnore) void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGraphicToIgnore)
{ {
// detect maximum allowed memory footprint. Use the user-settings of MaxCacheSize (defaulted // detect maximum allowed memory footprint. Use the user-settings of MaxCacheSize (defaulted
// to 20MB) and add a decent multiplicator (experimented to find one). Limit to // to 200MB). Limit to a useful maximum for 32Bit address space
// a useful maximum for 32Bit address space
// default is 20MB, so allow 200MB initially
static sal_uLong aMultiplicator(10);
// max at 500MB; I experimented with 800 for debug and 750 for non-debug settings (pics start // max at 500MB; I experimented with 800 for debug and 750 for non-debug settings (pics start
// missing when office reaches a mem footprint of 1.5GB) but some secure left over space for // missing when office reaches a mem footprint of 1.5GB) but some secure left over space for
...@@ -212,7 +208,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGrap ...@@ -212,7 +208,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGrap
static sal_uLong aMaxSize32Bit(500 * 1024 * 1024); static sal_uLong aMaxSize32Bit(500 * 1024 * 1024);
// calc max allowed cache size // calc max allowed cache size
const sal_uLong nMaxCacheSize(::std::min(GetMaxCacheSize() * aMultiplicator, aMaxSize32Bit)); const sal_uLong nMaxCacheSize(::std::min(GetMaxCacheSize(), aMaxSize32Bit));
if(mnUsedSize >= nMaxCacheSize) if(mnUsedSize >= nMaxCacheSize)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment