| Summary: | Need to limit memory usage | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Aaron Williams <aaronw> |
| Component: | nspluginviewer | Assignee: | George Staikos <staikos> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | lisaelimarie, Marcin.Kasperski |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Aaron Williams
2005-04-21 20:12:15 UTC
SVN commit 415756 by staikos:
add support for memory limits with hidden config variable. I may add a
UI option if and when I receive positive feedback that this code works.
I haven't tested it.
FEATURE: 104338
M +11 -0 trunk/KDE/kdebase/nsplugins/viewer/viewer.cpp
--- trunk/KDE/kdebase/nsplugins/viewer/viewer.cpp #415755:415756
@@ -37,6 +37,8 @@
#include <qptrlist.h>
#include <qsocketnotifier.h>
#include <stdlib.h>
+#include <sys/resource.h>
+#include <sys/time.h>
#include <unistd.h>
#ifdef Bool
@@ -249,6 +251,15 @@
if (v > 0) {
nice(v);
}
+ v = cfg.readNumEntry("Max Memory", 0);
+ if (v > 0) {
+ rlimit rl;
+ memset(&rl, 0, sizeof(rl));
+ if (0 == getrlimit(RLIMIT_AS, &rl)) {
+ rl.rlim_cur = kMin(v, int(rl.rlim_max));
+ setrlimit(RLIMIT_AS, &rl);
+ }
+ }
}
// initialize the dcop client
*** Bug 106507 has been marked as a duplicate of this bug. *** Hey George, I see this nice little setting is still in the 4SVN source.. you might think about that visible config option because my guess is noone ever found this ;) |