` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Decrease memory useage
2010-07-28 -- Zdravko
 
just will to share simple code which decrease app memory (in my example, from ~70 MB to ~5 MB) Also, it decreases most of other running app's (like Iexplore.exe, Outlook.exe etc.) It can be done with clean Clarion code, but I'm using ABC free Templates (Terminate a process part): (http://www.authord.com/products/Clarion/) to get all active Process into Queue: FreeMem ROUTINE TPLoadProcessesQueue() ! Fill all process into PeQueue LOOP L = 1 TO RECORDS(PeQue) GET(PeQue,L) ! You can filter here only your app, like this: ! IF PeQ:szExeFile <> 'your.exe' THEN CYCLE. ! PeQ:szExeFile is lower case ProcessHandle = OpenProcess(PROCESS_SET_QUOTA,fInherit,PeQ:th32ProcessID) X# = SetProcessWorkingSetSize(ProcessHandle,-1,-1) END Before that, you need to put this into global embed (Inside the global MAP) MODULE('WinApi') SetProcessWorkingSetSize(LONG,LONG,LONG),SIGNED,PASCAL,RAW END I'm calling FreeMem routine each 10 min (on event timer)


Today is May 3, 2024, 4:30 pm
This article has been viewed 35124 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: