On Sat, 2009-11-14 at 10:28 +1100, Jason Cox wrote:
> I have changed the setting for both rlim_cur and rlim_max from 300 to
> 30000
> curious though is that the following section of code seems to set it to
> 40000000 and then over write it to 300
>
> Jason
>
>
>
> #if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) ||
> defined( _MSC_VER )
> // the next bit crashes Cygwin for me - DCL
> // MSVC does not have the function or variable type defined - BRF
> #else
> // set mem allocation limit. Reason: occasionally the triangle()
> // routine can blow up and allocate memory forever. We'd like
> // this process to die before things get out of hand so we can try
> // again with a smaller interior angle limit.
> int result;
> struct rlimit limit;
> limit.rlim_cur = 40000000;
> limit.rlim_max = 40000000;
>
> #if 0
> result = setrlimit( RLIMIT_DATA, &limit );
> cout << "result of setting mem limit = " << result << endl;
> result = setrlimit( RLIMIT_STACK, &limit );
> cout << "result of setting mem limit = " << result << endl;
> result = setrlimit( RLIMIT_CORE, &limit );
> cout << "result of setting mem limit = " << result << endl;
> result = setrlimit( RLIMIT_RSS, &limit );
> cout << "result of setting mem limit = " << result << endl;
> #endif
>
> // cpu time limit since occassionally the triangulator can go into
> // an infinite loop.
> limit.rlim_cur = 300; // seconds
> limit.rlim_max = 300; // seconds
> result = setrlimit( RLIMIT_CPU, &limit );
> cout << "result of setting mem limit = " << result << endl;
> #endif // end of stuff that crashes Cygwin
>
>
The rlimits are there (as I understand it) for the case where we are
automatically batch generating the world, and a stuck tile would go
un-noticed for extended periods of time.
If your not running where you want to rlimit just comment the whole mess
out like this:
@@ -1178,12 +1178,12 @@ int main(int argc, char **argv) {
// routine can blow up and allocate memory forever. We'd like
// this process to die before things get out of hand so we can try
// again with a smaller interior angle limit.
+#if 0
int result;
struct rlimit limit;
limit.rlim_cur = 40000000;
limit.rlim_max = 40000000;
-#if 0
result = setrlimit( RLIMIT_DATA, &limit );
cout << "result of setting mem limit = " << result << endl;
result = setrlimit( RLIMIT_STACK, &limit );
@@ -1192,14 +1192,14 @@ int main(int argc, char **argv) {
cout << "result of setting mem limit = " << result << endl;
result = setrlimit( RLIMIT_RSS, &limit );
cout << "result of setting mem limit = " << result << endl;
-#endif
// cpu time limit since occassionally the triangulator can go into
// an infinite loop.
limit.rlim_cur = 300; // seconds
limit.rlim_max = 300; // seconds
result = setrlimit( RLIMIT_CPU, &limit );
cout << "result of setting mem limit = " << result << endl;
+#endif
#endif // end of stuff that crashes Cygwin
// main construction data management class
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel