<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Get Current Process Memory</title>
	<atom:link href="http://www.davinciunltd.com/2007/12/current-process-memory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davinciunltd.com/2007/12/current-process-memory/</link>
	<description>Jim McKeeth's blog on creative and innovative Delphi programming.</description>
	<pubDate>Tue, 02 Dec 2008 23:54:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Andreas Hausladen</title>
		<link>http://www.davinciunltd.com/2007/12/current-process-memory/#comment-108</link>
		<dc:creator>Andreas Hausladen</dc:creator>
		<pubDate>Fri, 28 Dec 2007 08:17:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.davinciunltd.com/2007/12/currentprocessmemory/#comment-108</guid>
		<description>Why do you allocate memory on the heap. The stack would do the same without the need for a try/finally block.

function CurrentProcessMemory: Cardinal;
var
  MemCounters: TProcessMemoryCounters;
begin
  MemCounters.cb := SizeOf(MemCounters);
  if GetProcessMemoryInfo(GetCurrentProcess, 
                    @MemCounters, 
                    SizeOf(MemCounters)) then
    Result := MemCounters.WorkingSetSize
  else
    RaiseLastOSError;
end;</description>
		<content:encoded><![CDATA[<p>Why do you allocate memory on the heap. The stack would do the same without the need for a try/finally block.</p>
<p>function CurrentProcessMemory: Cardinal;<br />
var<br />
  MemCounters: TProcessMemoryCounters;<br />
begin<br />
  MemCounters.cb := SizeOf(MemCounters);<br />
  if GetProcessMemoryInfo(GetCurrentProcess,<br />
                    @MemCounters,<br />
                    SizeOf(MemCounters)) then<br />
    Result := MemCounters.WorkingSetSize<br />
  else<br />
    RaiseLastOSError;<br />
end;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
