Introduction: Online A server specifically for the company's internal apk packaging services, due to the app's business and functionality and increased, APK packaging needs to rely on more and more resources, the last few days each time the APK packaging due to oom caused by the package failure. Because APK packaging business is not online business, but occasionally used, the frequency is basically the same as once a week. So moving the business to another server or adding a new server to the cost is not desirable, and then observed that the swap usage has always been 100%, indicating that the actual packaging process is useful to swap, so I am going to expand the swap to see if it can solve the problem of the packaging process oom.
Operation:
DD If=/dev/zero of=/data/swap_file bs=1m count=10000mkswap/data/swap_file format swapon/data/swap_file expansion swapoff/data/ Swap_file Shrinking capacity
After the expansion, the packaging process can be used normally. But the speed was lower than before. But because the APK packaging process is not too demanding for speed, it is acceptable relative to the previous unavailable.
"20180129" Java process often oom, expansion swap.