From 7e2ea27e5d56f5cf767a6718a0f5edc28e24af14 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 16 Mar 2016 15:14:13 +0100 Subject: tdf#93553 limit parallelism at zip save time to useful amount At ODT export time writing and zipping comtained data packages is nicely parallelized, but not limited to an upper bounds of threads to use. Together with memory consumption this makes ressource usage and runtime behaviour bad to crashing (mostly on 32bit). I have now limited the processing dependent on the number of available cores to get a good processing/ressource ratio. The result uses much less memory, is faster and runs on 32bit systems. Change-Id: I8bd516a9a0cefd644f5d7001214bc717f29770ab Reviewed-on: https://gerrit.libreoffice.org/23305 Tested-by: Jenkins Reviewed-by: Noel Grandin --- package/inc/ZipOutputStream.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'package/inc/ZipOutputStream.hxx') diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index 16740095bd92..f995469b29e6 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -69,6 +69,16 @@ private: throw(css::io::IOException, css::uno::RuntimeException); void writeEXT( const ZipEntry &rEntry ) throw(css::io::IOException, css::uno::RuntimeException); + + // ScheduledThread handling helpers + void consumeScheduledThreadEntry(ZipOutputEntry* pCandidate); + void consumeFinishedScheduledThreadEntries(); + void consumeAllScheduledThreadEntries(); + +public: + void reduceScheduledThreadsToGivenNumberOrLess( + sal_Int32 nThreads, + sal_Int32 nWaitTimeInTenthSeconds); }; #endif -- cgit