From 5f15a5466c1c24fd47652b4b54730556cf63ff19 Mon Sep 17 00:00:00 2001 From: Shoaib <35446260+shoaib42@users.noreply.github.com> Date: Fri, 9 Aug 2024 22:29:45 -0400 Subject: [PATCH] Update part4.rst --- doc/tutorials/basic/part4.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/tutorials/basic/part4.rst b/doc/tutorials/basic/part4.rst index 0afcda06..c1792537 100644 --- a/doc/tutorials/basic/part4.rst +++ b/doc/tutorials/basic/part4.rst @@ -53,6 +53,12 @@ toolbox. import multiprocessing pool = multiprocessing.Pool() + # OR use the following to ensure releasing memory after each evaluate call + # This helps in situation where an external library holds memory, ex: Tensorflow + # when maxtaskperchild is set to 1, a new process is forked after each completed task + # https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing.pool + # pool = multiprocessing.Pool(maxtasksperchild=1) + toolbox.register("map", pool.map) # Continue on with the evolutionary algorithm