我在AWS上设置了Superset,并在遇到此错误时尝试加载数据示例:
Traceback (most recent call last):
File "/usr/local/bin/superset", line 10, in <module>
manager.run()
File "/usr/local/lib/python2.7/dist-packages/flask_script/__init__.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/flask_script/__init__.py", line 383, in handle
res = handle(*args, **config)
File "/usr/local/lib/python2.7/dist-packages/flask_script/commands.py", line 216, in __call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/superset/cli.py", line 95, in load_examples
data.load_world_bank_health_n_pop()
File "/usr/local/lib/python2.7/dist-packages/superset/data/__init__.py", line 174, in load_world_bank_health_n_pop
pdf = pd.read_json(f)
File "/usr/local/lib/python2.7/dist-packages/pandas/io/json.py", line 211, in read_json
date_unit).parse()
File "/usr/local/lib/python2.7/dist-packages/pandas/io/json.py", line 279, in parse
self._parse_no_numpy()
File "/usr/local/lib/python2.7/dist-packages/pandas/io/json.py", line 496, in _parse_no_numpy
loads(json, precise_float=self.precise_float), dtype=None)
ValueError: Could not reserve memory block
如何解决此内存限制?
答案 0 :(得分:1)
我遇到同样的问题(在512M AWS)并通过添加交换来解决。
参考:https://github.com/apache/incubator-superset/issues/1986#issuecomment-279919030
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab