कर्नेल सेटिंग है
/ Proc / sys / VM / overcommit_memory
उत्कृष्ट लेख से उद्धरण :
Since 2.5.30 the values are: 0 (default): as before: guess about how much
overcommitment is reasonable, 1: never refuse any malloc(), 2: be precise
about the overcommit - never commit a virtual address space larger than swap
space plus a fraction overcommit_ratio of the physical memory. Here
/proc/sys/vm/overcommit_ratio (by default 50) is another user-settable
parameter. It is possible to set overcommit_ratio to values larger than 100.
(See also Documentation/vm/overcommit-accounting.)
यह कांटे के साथ-साथ नियमित मालॉक पर भी लागू होता है। यानी अगर आप इसे 0 पर सेट करते हैं, तो फोर्क को कॉपी पर लिख दिया जाएगा। कॉपी ऑन राइट का मतलब है कि एक बार ऐप के फोर्क हो जाने के बाद, यह दोनों प्रतियां मेमोरी पेजेज चाइल्ड का उपयोग करेंगी या मूल मेमोरी को बदलना शुरू कर देंगी।
अधिकांश वितरणों में मुझे पता है कि ओवरकमिटी 0. है, लेकिन यदि आप इसे 2 पर सेट करते हैं, तो सभी मेमोरी पेज पूरी तरह से वास्तविक मेमोरी द्वारा समर्थित होंगे और कुछ मामलों में उच्च मेमोरी दबाव में अधिक स्थिर होगा, लेकिन कुछ प्रोग्राम (मैंने गिट का सामना किया) जो भरोसा करते हैं overcommits में विफल हो जाएगा।
If enough is available the kernel will commit to the full virtual size of the parent for both processes after the fork.हाँ धन्यवाद। मतलब है कि सीमित मेमोरी (रैम और स्वैप) वाले वातावरण में प्रक्रिया के आभासी पदचिह्न को कम करने से कांटा नहीं होने के मुद्दे को हल किया जा सकता है।