ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Application memory limiter

<< < (3/3)

40hz:
Please anybody know about such thing
-ruskiem (August 09, 2014, 10:33 AM)
--- End quote ---

IIRC there used to be something called a "job object" where you could do something similar.

My infobase has something from CodeProject that a coder might be able to use for ideas about ways to accomplish it.

Here's the link to the CodeProject page. But from the looks of it, it's a 32-bit solution and it's pretty old.

Can't comment beyond that. The CodeProject page was part of some research I was doing for a client for something I've long since forgotten about. Apologies. :-[


Funny thing...the old Macintosh operations systems (Prior to OSX) used to have that capability. If you requested "info" on an app (equivalent to "properties" in Windows) you got this window (see below) where you could easily set the min/max amount of RAM use allowed per application...



With heavyweight graphic apps like Photoshop and Quark you often had to fiddle with those values to find a setting that minimized app crashes on your machine. Otherwise you'd get one of those dreaded "bomb" notifications.




Back when 8Mb was considered a full RAM complement, futzing with RAM settings was a big - and necessary -  deal.

Edvard:
IIRC there used to be something called a "job object" where you could do something similar.
-40hz (August 09, 2014, 03:44 PM)
--- End quote ---

There still is:
http://msdn.microsoft.com/en-us/library/ms684161%28VS.85%29.aspx
A job object allows groups of processes to be managed as a unit. Job objects are namable, securable, sharable objects that control attributes of the processes associated with them. Operations performed on a job object affect all processes associated with the job object. Examples include enforcing limits such as working set size and process priority or terminating all processes associated with a job.
--- End quote ---

No idea where to go from there, but there's example code from the links at that page.

R-X:
Hi guys,
New user here but exact same requirements as vbmark. I have an application that I know is running away when it hits 1gb RAM. I currently have a solution which I'm running on Windows 7 x64 but I want a better one as described above.

To assist those looking for *something* I use a little app called Usage Monitor which has the capability to monitor a memory level on a given process and take action once that level is hit. I have it executing a batch file which includes a taskkill.exe command to kill off the offending process and a blat.exe command to email me so I can see when this happens (all hours it seems).

The problem with this setup is that the memory limit on the process seems to have to be set every time the process is created and I often forget to set the limit until I notice it has taken all available RAM and made my PC run like a 286. It would also be nice if that util could accept the commands straight into its own menus but it gets the job done and the best improvement to it would be to just monitor for when that process starts so I don't have to set it every time.

I had a bit of a look for other tools which brought me here but haven't found anything else so far.

Enjoy

skwire:
New user here but exact same requirements as vbmark.-R-X (October 14, 2014, 07:38 PM)
--- End quote ---

Hi, R-X, and welcome to the DonationCoder forums.   :)  My script from above can easily be adapted to do what you want.  It current just shows a message box when the memory limit is exceeded but that can be changed to kill a process.  Are you familiar with AutoHotkey scripting?

mouser:
NANY 2015 is coming up, this might be time for me to add features to Process Piglet tool that would do this kind of thing.
It would assist me if you could try it and tell me how you'd like me to add the new features.

Navigation

[0] Message Index

[*] Previous page

Go to full version