python multiprocessing 사용시
self.pid = os.for() 부분에서 Cannot allocate memoery 문제가 발생합니다.
메모리가 남아도는데도 해당 오류가 발생하여 다른 원인으로 생각하고 해결방법을 찾아봤습니다.
해결방법은 아래 명령어를 입력해서 설정을 바꾸면 됩니다.
sudo bash -c "echo vm.overcommit_memory=1 >> /etc/sysctl.conf"
sudo sysctl -p
아래는 해결방법을 찾은 글입니다.
github.com/openai/gym/issues/110#issuecomment-220672405
Monitoring causes OOM Error when python holds more than 50% of available memory · Issue #110 · openai/gym
tl;dr It is useful if gym supports a recording method which does not involve subprocess.Popen. When monitoring is enabled, ImageEncoder execute recoding in subprocess with Popen. Popen requests OS ...
github.com
아래는 해당 원인에 대해서 설명한 블로그 글입니다.
hakkyoonjung31.github.io/linux/memory-overcommit/
메모리 상승과 오버커밋
사내 테스트용 DB서버에서 프로세스에 메모리할당을 하지못하는 부하문제가 발생하여 메모리 할당에 실패한 시간대에 메모리 사용량을 조사하였다$ sar -r -f /var/log/sa/sarXX결과적으로 %commit가 100
hakkyoonjung31.github.io
'오류해결' 카테고리의 다른 글
오류해결 Host key verification failed (0) | 2021.04.13 |
---|---|
오류 해결 _auth_source_manager_obj (0) | 2020.12.21 |
오류 해결 Cannot find installation of real FFmpeg (0) | 2019.04.09 |