diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-11-18 17:37:53 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-11-18 17:39:15 +0100 |
commit | dbdacc73ae154237314d599194cc686bd738a9bf (patch) | |
tree | 3acf345112daf0fa201fcfab5e5ef6e5016acc32 | |
parent | 7dcfafc7d2f7ce8357c1570ea7547b5879f54172 (diff) |
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
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index e19df23e094c..fec8d259cbe0 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -1466,7 +1466,7 @@ objects.</desc> <label>Total Graphic Cache Size</label> </info> - <value>22000000</value> + <value>220000000</value> </prop> <prop oor:name="ObjectCacheSize" oor:type="xs:int" oor:nillable="false"> <info> diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 2ff619254a21..19ab956f499b 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -200,11 +200,7 @@ namespace void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGraphicToIgnore) { // 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 - // a useful maximum for 32Bit address space - - // default is 20MB, so allow 200MB initially - static sal_uLong aMultiplicator(10); + // to 200MB). Limit to a useful maximum for 32Bit address space // 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 @@ -212,7 +208,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGrap static sal_uLong aMaxSize32Bit(500 * 1024 * 1024); // 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) { |