[fdo-users] RE: (dbgql_define_rdb) Memory Error when call FDOCmd.Execute()

Gavin Cramer gavin.cramer at autodesk.com
Wed Feb 23 11:38:45 EST 2011


XP 32-bit has a memory manager that is significantly weaker than any newer version (XP x64, Vista, Windows 7, maybe Windows Server of any version).  If you have a machine available that has any of these versions, executing your code on it is probably the easiest way to tell if this is a fragmentation problem. That is, if your application succeeds or at least gets further, it's probably a fragmentation issue.

An alternative test would be to compile your application in Release mode and run it outside the debugger.  This will reduce heap usage.

The failure only during fdoSelectCmd.execute() may just be a matter of the other code never asking for such a large internal buffer.  Other memory-allocating components of your application (such as the Oracle client library) may already have allocated much of what they need before you get that far, so continuing to use them would not hit an allocation failure.

If either of the above tests show an improvement, it's worth taking a closer look at the heap's condition.  On Windows, the main calls to do this are:

GetProcessHeaps
HeapValidate
HeapWalk
HeapCompact (this one never helped me, but it's easy to try)

HeapWalk gives you lots of information regarding heap entries using a datatype called PROCESS_HEAP_ENTRY.  Its data member 'cbData' gives the size of the contents of a free block, so finding the maximum entry value tells you the biggest memory request that can succeed.  Your application may be running multiple threads (even if you haven't asked for them) and each thread gets its own heap.  So, I recommend scanning all of them and figuring out which heap changes when you execute FDO commands -- that's the one to analyse for maximum entry size.

If this does turn out to be a fragmentation issue, it is going to be important for you to find out what other components are doing with the heap _before_ you start executing FDO code.  Some other component may be allocating a lot of small objects, leaving the heap with no large free entries.

Gavin

	
-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Ray
Sent: Wednesday, February 23, 2011 10:04 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] RE: (dbgql_define_rdb) Memory Error when call FDOCmd.Execute()


I am running an independent FDO application and I am using Window XP OS.

The thing puzzles me is that only the fdoSelectCmd.execute() has the
problem. If I put a breakpoint there and skip the exception. Other code
including .NET code, Oracle command code works fine. Even other fdo code
still works fine, like I can create new fdo InsertCmd, run
insertCmd.execute(), and fdoInsertCmd succeeded in inserting records to
database. I can also create new fdoSelectCmd, but just
fdoSelectCmd.Execute() throws the memory error.

Any special memory requirement for fdoselectcmd.execute()?
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/dbgql-define-rdb-Memory-Error-when-call-FDOCmd-Execute-tp6054318p6056618.html
Sent from the FDO Users mailing list archive at Nabble.com.
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list