Message321788
I'm using macOX and I got huge memory usage when using generator with multiprocess. (see file)
I think this is because (https://github.com/python/cpython/blob/master/Lib/multiprocessing/pool.py#L383)
if not hasattr(iterable, '__len__'):
iterable = list(iterable)
if chunksize is None:
chunksize, extra = divmod(len(iterable), len(self._pool) * 4)
if extra:
chunksize += 1
When we convert an iterable to list(iterable), we lost the advantage of using the generator. I'm not sure how to fix it, maybe we can set a default value for an object don't have '__len__' attr, any ideas? |
|
Date |
User |
Action |
Args |
2018-07-17 04:03:50 | Windson Yang | set | recipients:
+ Windson Yang, zach.ware |
2018-07-17 04:03:50 | Windson Yang | set | messageid: <1531800230.72.0.56676864532.issue34134@psf.upfronthosting.co.za> |
2018-07-17 04:03:50 | Windson Yang | link | issue34134 messages |
2018-07-17 04:03:50 | Windson Yang | create | |
|