الأمثلية استضافة ويب المشترك
If you are the مسؤول for a الخادم that هو shared بواسطة hosting several مربع متوسط ويب sites, you can أمثلية الأداء و زيادة موقع السعة بواسطة إضافة the following gcTrimCommitOnLowMemory إعداد إلى the runtime عقدة في the Aspnet.config ملف في the .NET Framework الدليل:
<gcTrimCommitOnLowMemory enabled="true|false"/>
![]() |
---|
This إعداد هو recommended فقط for shared ويب hosting scenarios. |
Because the حاوي المهملات retains ذاكرة for future allocations, its committed مسافة can be المزيد what هو strictly needed. You can reduce this مسافة إلى accommodate مرة/مرات when there هو a heavy تحميل تشغيل النظام ذاكرة. Reducing this committed مسافة improves الأداء و expands the السعة إلى مضيف المزيد sites.
When the gcTrimCommitOnLowMemory إعداد هو ممكّن, the حاوي المهملات evaluates the النظام ذاكرة تحميل و enters a trimming الوضع when the تحميل reaches 90%. It maintains the trimming الوضع until the تحميل drops under 85%.
عند السماح للشروط، حاوي المهملات أن تقرر التي gcTrimCommitOnLowMemoryإعداد لا يساعد في تطبيق الحالي و تجاهل it.
المثال
تقسيم XML التالي يوضح كيفية إلى تمكين gcTrimCommitOnLowMemoryإعداد. الإشارة إلى علامات الحذف غير ذلك الإعدادات التي ستكون في runtimeعقدة.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<runtime>
. . .
<gcTrimCommitOnLowMemory enabled="true"/>
</runtime>
. . .
</configuration>