about summary refs log tree commit diff
path: root/kindlecomicconverter/comic2ebook.py
diff options
context:
space:
mode:
Diffstat (limited to 'kindlecomicconverter/comic2ebook.py')
-rwxr-xr-xkindlecomicconverter/comic2ebook.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py
index f5c6320..f2d0fc6 100755
--- a/kindlecomicconverter/comic2ebook.py
+++ b/kindlecomicconverter/comic2ebook.py
@@ -455,7 +455,7 @@ def buildEPUB(path, chapterNames, tomeNumber):
 
 def imgDirectoryProcessing(path):
     global workerPool, workerOutput
-    workerPool = Pool()
+    workerPool = Pool(maxtasksperchild=100)
     workerOutput = []
     options.imgMetadata = {}
     options.imgOld = []
@@ -1185,9 +1185,11 @@ def makeMOBI(work, qtGUI=None):
         threadNumber = 1
     elif 2 < availableMemory <= 4:
         threadNumber = 2
-    else:
+    elif 4 < availableMemory <= 8:
         threadNumber = 4
-    makeMOBIWorkerPool = Pool(threadNumber)
+    else:
+        threadNumber = None
+    makeMOBIWorkerPool = Pool(threadNumber, maxtasksperchild=10)
     for i in work:
         makeMOBIWorkerPool.apply_async(func=makeMOBIWorker, args=(i, ), callback=makeMOBIWorkerTick)
     makeMOBIWorkerPool.close()