<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:54:26 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-538] SetProcessWorkingSetSizeEx for win32?</title>
                <link>https://jira.mongodb.org/browse/SERVER-538</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;need to investigate&lt;/p&gt;</description>
                <environment></environment>
        <key id="11117">SERVER-538</key>
            <summary>SetProcessWorkingSetSizeEx for win32?</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="eliot">Eliot Horowitz</reporter>
                        <labels>
                            <label>Windows</label>
                    </labels>
                <created>Wed, 13 Jan 2010 11:24:36 +0000</created>
                <updated>Wed, 3 Jan 2018 04:12:35 +0000</updated>
                            <resolved>Wed, 18 Nov 2015 18:06:09 +0000</resolved>
                                                                    <component>Stability</component>
                                        <votes>6</votes>
                                    <watches>14</watches>
                                                                                                                <comments>
                            <comment id="1091961" author="dan@10gen.com" created="Wed, 18 Nov 2015 18:06:09 +0000"  >&lt;p&gt;Resolving as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17861&quot; title=&quot;Change the default storage engine to wiredTiger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17861&quot;&gt;&lt;del&gt;SERVER-17861&lt;/del&gt;&lt;/a&gt;.  Now that WiredTiger is the default storage engine, memory usage can be controlled by setting the WiredTiger cache size, though users must take into account additional memory usage requirements of the process and the specific workload.&lt;/p&gt;</comment>
                            <comment id="715589" author="andrewk" created="Wed, 10 Sep 2014 13:29:09 +0000"  >&lt;p&gt;And again, anyone? Hello? Bueller? Bueller?&lt;/p&gt;

&lt;p&gt;Seriously, how can this ticket still not be resolved? I&apos;ve had an external process setting the max process size for the mongod job object since 2009 without issues.&lt;/p&gt;</comment>
                            <comment id="346740" author="andrewk" created="Tue, 28 May 2013 11:01:07 +0000"  >&lt;p&gt;Ping... any sign of life in the progress of this ticket?&lt;/p&gt;</comment>
                            <comment id="181278" author="li.tsunglin" created="Thu, 1 Nov 2012 03:17:29 +0000"  >&lt;p&gt;While SetProcessWorkingSetSize only works once when it is called, limitation set by job object will be applied always.&lt;/p&gt;</comment>
                            <comment id="180979" author="tad" created="Wed, 31 Oct 2012 14:53:06 +0000"  >&lt;p&gt;Hi Li,&lt;/p&gt;

&lt;p&gt;Thanks for the suggestion!&lt;/p&gt;

&lt;p&gt;Did you try SetProcessWorkingSetSizeEx() and find that it didn&apos;t work for you?&lt;/p&gt;

&lt;p&gt;My understanding of job objects was that they were for grouping related processes.  I did not know that they provided features such as limiting working set sizes.&lt;/p&gt;

&lt;p&gt;Does this have an advantage over the other API?&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="180837" author="li.tsunglin" created="Wed, 31 Oct 2012 07:17:13 +0000"  >&lt;p&gt;FYI, this is what we did for limiting working set usage on Windows 7.&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;#ifdef _WIN32&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    if (params.count(&quot;workingset&quot;)) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        int working_set = params[&quot;workingset&quot;].as&amp;lt;int&amp;gt;();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        const __int64 oneMB = 1024*1024i64;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        ::HANDLE hJob = CreateJobObject(NULL, NULL);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;			&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobext;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        jobext.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_WORKINGSET | JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        jobext.BasicLimitInformation.MaximumWorkingSetSize = working_set*oneMB;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        jobext.BasicLimitInformation.MinimumWorkingSetSize = oneMB;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        if (::SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &amp;amp;jobext, sizeof(jobext)) == FALSE) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            out() &amp;lt;&amp;lt; &quot;failed to SetInformationJobObject, with maximum working set size &quot; &amp;lt;&amp;lt; working_set&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                  &amp;lt;&amp;lt; &quot; MB, error = &quot; &amp;lt;&amp;lt; ::GetLastError() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        else if (::AssignProcessToJobObject(hJob, ::GetCurrentProcess()) == FALSE) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            out() &amp;lt;&amp;lt; &quot;failed to AssignProcessToJobObject, error = &quot; &amp;lt;&amp;lt; ::GetLastError() &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                  &amp;lt;&amp;lt; &quot;, this won&apos;t work under debugger.&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;#endif&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="95109" author="tad" created="Sun, 4 Mar 2012 21:17:05 +0000"  >&lt;p&gt;Consolidating closely related tickets into one.&lt;/p&gt;</comment>
                            <comment id="71779" author="wojo" created="Thu, 8 Dec 2011 19:37:49 +0000"  >&lt;p&gt;I have since bumped it to 2GB (out of 4GB total). I have since lost the logs for this instance, but I can try to replicate in our development environment.&lt;/p&gt;</comment>
                            <comment id="71774" author="tad" created="Thu, 8 Dec 2011 19:19:39 +0000"  >&lt;p&gt;I haven&apos;t done testing with WSRM (or SetProcessWorkingSetSizeEx) yet and this bug is marked for &quot;2.1 planning&quot; so it isn&apos;t getting attention yet, but if you have a log with anything interesting in it, could you add it to the bug, please?&lt;br/&gt;
A repair requires rewriting chunks of data, so a 1 GB working set limit might well be too low for it to work well.  Do you need the limit to be so low?  I suspect that the best value for working set size is some high fraction of your total RAM; the main objective should be to keep paging manageable by making sure that the working set is not larger than physical memory.&lt;/p&gt;</comment>
                            <comment id="71760" author="wojo" created="Thu, 8 Dec 2011 18:58:24 +0000"  >&lt;p&gt;I have a potential wrench to throw out there. I&apos;m using WSRM in 2008 R2 with an resource allocation policy allowing a maximum of 1GB to MongoDB, which has worked great for months. It does basically the same thing as SetProcessWorkingSizeEx just from the outside and requires Windows Server 2008 of course.&lt;/p&gt;

&lt;p&gt;However, we recently had a server crash and when MongoDB came up it had to do a repair. Thing is, it wouldn&apos;t finish. I have no idea why, but I couldn&apos;t get MongoDB back up and running until I first removed the resource allocation policy in WSRM and tried again. That time it worked.&lt;/p&gt;

&lt;p&gt;Is there something in the DB repair process that requires a certain amount of memory for a database of a certain size? Our database is about 11GB in size (16GB total for MongoDB including the journal, etc).&lt;/p&gt;</comment>
                            <comment id="70787" author="tad" created="Mon, 5 Dec 2011 00:43:40 +0000"  >&lt;p&gt;Regarding my comment from Nov 30 2011 11:24:55 AM UTC where I suggested calling SetProcessWorkingSetSize() when SetProcessWorkingSetSizeEx() isn&apos;t available, this turns out to be useless.  I watched a Mark Russinovitch talk where he specifically said that the maximum working set parameter of SetProcessWorkingSetSize() does nothing and hasn&apos;t for years.  The Ex version, with the extra flag, does work, just the fallback for XP and Server 2003 won&apos;t help.&lt;/p&gt;</comment>
                            <comment id="69897" author="tad" created="Wed, 30 Nov 2011 19:41:21 +0000"  >&lt;p&gt;Thanks, Andrew, that&apos;s great to know.  Currently, this ticket is set at &quot;2.1 planning&quot;, which means that I need to complete the stuff with &quot;closer&quot; fix-by versions before doing this, but I&apos;m looking at Windows memory consumption and this might be helpful there.  You&apos;ll see activity on this bug whenever I or someone else gets working on it; I wanted to get some of my thoughts written into the bug while I was reviewing it.&lt;/p&gt;</comment>
                            <comment id="69877" author="andrewk" created="Wed, 30 Nov 2011 18:45:04 +0000"  >&lt;p&gt;Tad, for what it&apos;s worth, we have been using SetProcessWorkingSetSizeEx() in production since I logged this ticket (and then even before that). We&apos;ve used it with almost every version of MongoDB since 1.2.4 under Window Server 2008 R2 and have never had a problem. It has worked perfectly - even where we have multiple MongoDB instances on the same machine.&lt;/p&gt;

&lt;p&gt;I am more than happy to test your changes for you.&lt;/p&gt;</comment>
                            <comment id="69743" author="tad" created="Wed, 30 Nov 2011 11:24:55 +0000"  >&lt;p&gt;We could use SetProcessWorkingSetSizeEx() on machines that have that function available (Vista, Server 2008, Windows 7, Server 2008 R2) and use SetProcessWorkingSetSize() for the rest (Windows XP, Server 2003).  We would need to do some testing to see how much each of these helps, and document our findings on the Wiki.  Also, these are Windows APIs that could be called at any time, so in addition to a command line switch we should implement a changeable setting (admin-only or localhost-only) that would let users &quot;tune&quot; a running instance, and document how and when to use that.&lt;/p&gt;</comment>
                            <comment id="29185" author="sym3tri" created="Mon, 18 Apr 2011 07:38:43 +0000"  >&lt;p&gt;Just found this blog post. Seems to solve the problem with an optional windows server native component.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.captaincodeman.com/2011/02/27/limit-mongodb-memory-use-windows/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.captaincodeman.com/2011/02/27/limit-mongodb-memory-use-windows/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18958" author="wojo" created="Wed, 6 Oct 2010 16:51:37 +0000"  >&lt;p&gt;Please check out the following commit that allows you to set the limit and should support any Windows OS (errors out gracefully if you try to use it on an older version)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/wojo/mongo/commit/a6e1b6892be9ea2733f4c2bc4059713dc0a7d459&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/wojo/mongo/commit/a6e1b6892be9ea2733f4c2bc4059713dc0a7d459&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m sure it needs some tiny tweaks (style, proper error codes, etc) but it works here in our environment well!&lt;/p&gt;

&lt;p&gt;Comments?&lt;/p&gt;</comment>
                            <comment id="16231" author="wojo" created="Tue, 27 Jul 2010 21:41:54 +0000"  >&lt;p&gt;Justin, absolutely. I&apos;ll do the same on my end. I just need to bite the bullet and get a mongo build environment up &amp;#8211; shouldn&apos;t be too hard.&lt;/p&gt;</comment>
                            <comment id="16230" author="zippy1981" created="Tue, 27 Jul 2010 21:38:24 +0000"  >&lt;p&gt;Robert,&lt;/p&gt;

&lt;p&gt;Agreed. I might try to implement it that way myself when I got some time.&lt;/p&gt;

&lt;p&gt;However, rather than arguing to make our case to keep the ticket open, us community contributors should write a patch to dynamically load the function submit a pull request, and then the 10gen people can do their performance testing when we have code to show them.&lt;/p&gt;

&lt;p&gt;Justin&lt;/p&gt;</comment>
                            <comment id="16222" author="wojo" created="Tue, 27 Jul 2010 21:08:02 +0000"  >&lt;p&gt;Why was this implementing using a direct call? It could be done using LoadLibrary, GetProcAddress and a function pointer to dynamically load and then call the function SetProcessWorkingSetSizeEx depending on OS version. That way it&apos;ll be portable to all versions of Windows including XP.&lt;/p&gt;

&lt;p&gt;This would be a very simple change and would satisfy all requirement I believe. If anyone needs help on this let me know. I really need to get a mongo build environment up anyway! &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Can this be re-opened and fixed this way?&lt;/p&gt;</comment>
                            <comment id="15932" author="redbeard0531" created="Mon, 19 Jul 2010 18:37:33 +0000"  >&lt;p&gt;We can&apos;t do this as long as we want to support back to WinXP with a single binary. If you use a build with this on WinXP you get the following error before the DB starts:&lt;/p&gt;

&lt;p&gt;&quot;The procedure entry point SetProcessWorkingSetSizeEx could not be located in the dynamic link library KERNEL32.dll&quot;&lt;/p&gt;

&lt;p&gt;This happens even if you build on WinXP.&lt;/p&gt;</comment>
                            <comment id="15931" author="auto" created="Mon, 19 Jul 2010 18:35:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;RedBeard0531&apos;, &apos;name&apos;: &apos;Mathias Stearn&apos;, &apos;email&apos;: &apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Revert &quot;Try using SetProcessWorkingSetSizeEx &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-538&quot; title=&quot;SetProcessWorkingSetSizeEx for win32?&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-538&quot;&gt;&lt;del&gt;SERVER-538&lt;/del&gt;&lt;/a&gt;&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit f1146af710f5f5dab69927f4277ee16a72e1d0c0.&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/832601945f229d689707fdc06cde532dd051fa2f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/832601945f229d689707fdc06cde532dd051fa2f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15907" author="auto" created="Mon, 19 Jul 2010 12:36:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;RedBeard0531&apos;, &apos;name&apos;: &apos;Mathias Stearn&apos;, &apos;email&apos;: &apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Try using SetProcessWorkingSetSizeEx &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-538&quot; title=&quot;SetProcessWorkingSetSizeEx for win32?&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-538&quot;&gt;&lt;del&gt;SERVER-538&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Committing to get a win64 build.&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/f1146af710f5f5dab69927f4277ee16a72e1d0c0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/f1146af710f5f5dab69927f4277ee16a72e1d0c0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="14590" author="andrewk" created="Fri, 4 Jun 2010 06:25:19 +0000"  >&lt;p&gt;I should have mentioned earlier the QUOTA_LIMITS_HARDWS_MAX_ENABLE switch. &lt;/p&gt;

&lt;p&gt;This is what I&apos;m using in much the same way as Robert. I&apos;ve been running this in production for months without any problems.&lt;/p&gt;</comment>
                            <comment id="14581" author="eliot" created="Thu, 3 Jun 2010 18:28:55 +0000"  >&lt;p&gt;we should try that method&lt;/p&gt;</comment>
                            <comment id="14580" author="wojo" created="Thu, 3 Jun 2010 18:12:13 +0000"  >&lt;p&gt;I was able to limit the working set of mongod.exe to 1GB by calling SetProcessWorkingSetSizeEx on mongod.exe and setting the dwMaximumWorkingSetSize to 1GB (for example) with the flag QUOTA_LIMITS_HARDWS_MAX_ENABLE. I did this via a small c application that obtained debugger rights and set the quota based on the pid externally.&lt;/p&gt;

&lt;p&gt;During my testing it correctly limited mongod.exe to a working set of 1GB no matter what I did in mongodb (large queries that touched many GB worth of data, etc). Before that it was eating up all available memory and causing the entire system to get sluggish.&lt;/p&gt;

&lt;p&gt;There&apos;s no reason why this can&apos;t be made conditional depending on which version of Windows you are running. If over Vista or Server 2003 you can make a dynamic call to Kernel32.dll and set the quota.&lt;/p&gt;

&lt;p&gt;All in all, this seems to help a lot on a Windows Server 2008 R2 box with other servers running on it.&lt;/p&gt;</comment>
                            <comment id="14148" author="eliot" created="Mon, 10 May 2010 13:59:59 +0000"  >&lt;p&gt;In all of our tests this had no effect.&lt;/p&gt;</comment>
                            <comment id="14147" author="andrewk" created="Mon, 10 May 2010 13:58:16 +0000"  >&lt;p&gt;Any update on the last comment here? Can this be made conditional? I would think that most instances of mongo would be run on an OS newer than Vista.&lt;/p&gt;

&lt;p&gt;Being able to to call this function via a shell command passing in both values (min/max working set) and potentially passing in the relevant flag would allow for a lot of control over how workingset is managed.&lt;/p&gt;

&lt;p&gt;Control of this has very useful in our production environment for the past 5 months.&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;</comment>
                            <comment id="11848" author="andrewk" created="Wed, 20 Jan 2010 05:47:02 +0000"  >&lt;p&gt;Mathias - is there no way to make this conditional? &lt;/p&gt;

&lt;p&gt;Also, were you able to confirm if SetProcessWorkingSetSizeEx does indeed establish a hard limit?&lt;/p&gt;</comment>
                            <comment id="11803" author="redbeard0531" created="Fri, 15 Jan 2010 19:50:54 +0000"  >&lt;p&gt;SetProcessWorkingSetSizeEx is only available in Vista and higher so we can&apos;t use it. SetProcessWorkingSetSize doesn&apos;t establish a hard limit on the working set.&lt;/p&gt;</comment>
                            <comment id="11748" author="eliot" created="Wed, 13 Jan 2010 13:38:33 +0000"  >&lt;p&gt;Haven&apos;t had a chance to look at yet.&lt;/p&gt;

&lt;p&gt;Mathias, can you test and see if it works for mmap?&lt;/p&gt;</comment>
                            <comment id="11747" author="andrewk" created="Wed, 13 Jan 2010 12:43:02 +0000"  >&lt;p&gt;Did SetProcessWorkingSetSizeEx() with the correct flags have more effect than SetProcessWorkingSetSize()?&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="193707">SERVER-17861</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="32153">SERVER-5194</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>31.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000UaVgqIAF]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 13 Jan 2010 12:43:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 13 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 13 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrewk</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>sym3tri</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>zippy1981</customfieldvalue>
            <customfieldvalue>li.tsunglin</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>wojo</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpt0f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfq8f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4155</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrspvb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>