Message297257
I'm working on a MMORPG Game server, and using the 32bit window Python(Python2.7.9 and Python3.6.0).
And i create a zlib.compressobj for every connection.
when the connection reach about 7500, the program raise an MemoryError exception. The Program only took me 700MB in memory, But the committed memory is about 2GB.
Here is my test result and test code:
-----------test result------------------
7613 compressobj created!
('memory info:', pmem(rss=736342016, vms=2057256960, num_page_faults=179812, pea
k_wset=736342016, wset=736342016, peak_paged_pool=130760, paged_pool=130584, pea
k_nonpaged_pool=28344, nonpaged_pool=28344, pagefile=2057256960, peak_pagefile=2
057256960, private=2057256960))
--------------test code ----------------
# -*- encoding:utf-8 -*-
import os
import psutil
import zlib
def test():
result = []
for i in range(10000):
try:
result.append(zlib.compressobj())
except:
print('%d compressobj created!'%(i))
pid = os.getpid()
p = psutil.Process(pid)
print('memory info:', p.memory_info())
break
if __name__ == '__main__':
test() |
|
Date |
User |
Action |
Args |
2017-06-29 05:56:39 | dennisding | set | recipients:
+ dennisding, paul.moore, tim.golden, zach.ware, steve.dower |
2017-06-29 05:56:39 | dennisding | set | messageid: <1498715799.11.0.0910878994528.issue30800@psf.upfronthosting.co.za> |
2017-06-29 05:56:38 | dennisding | link | issue30800 messages |
2017-06-29 05:56:38 | dennisding | create | |
|