[asterisk-commits] rizzo: branch rizzo/video_v2 r85130 - /team/rizzo/video_v2/main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 9 10:21:50 CDT 2007


Author: rizzo
Date: Tue Oct  9 10:21:49 2007
New Revision: 85130

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85130
Log:
temporary hack to limit memory to 128M while tracking down
an allocation failure.


Modified:
    team/rizzo/video_v2/main/asterisk.c

Modified: team/rizzo/video_v2/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/main/asterisk.c?view=diff&rev=85130&r1=85129&r2=85130
==============================================================================
--- team/rizzo/video_v2/main/asterisk.c (original)
+++ team/rizzo/video_v2/main/asterisk.c Tue Oct  9 10:21:49 2007
@@ -2676,6 +2676,23 @@
 	if (!ast_language_is_prefix && !ast_opt_remote)
 		ast_log(LOG_WARNING, "The 'languageprefix' option in asterisk.conf is deprecated; in a future release it will be removed, and your sound files will need to be organized in the 'new style' language layout.\n");
 
+	if (1) {
+		struct rlimit l;
+		memset(&l, 0, sizeof(l));
+		l.rlim_cur = 128*1024*1024;
+		l.rlim_max = l.rlim_cur;
+		if (setrlimit(RLIMIT_AS, &l)) {
+			ast_log(LOG_WARNING, "Unable to set map size resource limit: %s\n", strerror(errno));
+		}
+		memset(&l, 0, sizeof(l));
+		l.rlim_cur = 128*1024*1024;
+		l.rlim_max = l.rlim_cur;
+		if (setrlimit(RLIMIT_DATA, &l)) {
+			ast_log(LOG_WARNING, "Unable to set data size resource limit: %s\n", strerror(errno));
+		}
+		ast_log(LOG_WARNING, "set limits to 128M\n");
+	}
+
 	if (ast_opt_dump_core) {
 		struct rlimit l;
 		memset(&l, 0, sizeof(l));




More information about the asterisk-commits mailing list