Detecting ulimit problem

Eric Frias efrias at syncad.com
Thu May 19 09:58:58 CDT 2005


I just ran into bug 2609:
	http://bugs.winehq.org/show_bug.cgi?id=2609
which is that wine fails to initialize when the user has a ulimit for 
virtual memory (address space) set to less than around 1300MB.  This is 
something wine could test for and issue a warning.  I know this isn't 
technically a problem with wine, but it's pretty unusual for an 
application to require that much address space.  A user might not even 
realize they have a limit set if they haven't encountered problems with 
other large applications.  It looks like I'm at least the third person 
to encounter this, and a hint to look at ulimit instead of other things 
(like the overcommit_memory setting) would've saved me some time.

Something like:
	struct rlimit address_limits;
	int required_address_space = 1024 * 1024 * 1400; /* 1400M */
	getrlimit(RLIMIT_AS, &address_limits);
	if (address_limits.rlim_max < required_address_space)
		WINE_WARN("Your virtual memory limit is set to %dk, which 
will\nprobably prevent wine from loading correctly.  If you get an 
error,\nincrease the limit with 'ulimit -v' to at least %dk.\n", 
address_limits.rlim_max / 1024, required_address_space / 1024);

I don't know how to determine the exact amount of address space wine 
requires, since it seems to vary somewhat with the application -- 1300M 
is enough for notepad, our own winelib app requires at least 1375M.

Would a warning like this be appropriate?

Eric



More information about the wine-devel mailing list