Microsoft KB Archive/926100

= You may receive an &quot;E_OUTOFMEMORY&quot; error message when you call an out-of-process COM server that must marshal a variant parameter =

Article ID: 926100

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft COM+ 2.0 Standard Edition
 * Microsoft COM+ 2.0 Standard Edition

-



SYMPTOMS
When you call an out-of-process Microsoft Component Object Model (COM) server, you may receive an &quot;E_OUTOFMEMORY&quot; error message. This issue occurs when the COM server must marshal a variant parameter.



CAUSE
This issue occurs because the following conditions must be true when you perform a DCOM call:
 * The remote procedure call must allocate enough buffer space to marshal the data.
 * The memory for the buffer must be contiguous.

If contiguous memory cannot be allocated, the COM interface returns an &quot;E_OUTOFMEMORY&quot; error message. Depending on the data type that is used, you may have to have a buffer that is two times as large or larger than the actual size of the data type. The additional buffer space accounts for common variant fields and byte alignment constraints.



WORKAROUND
To work around this issue, use one of the following methods:
 * Send the data in smaller chunks.
 * If it is possible, do not use variant parameters or do not use variant parameters that have embedded complex structures.
 * Bypass the remote procedure call marshaler completely by creating your own custom marshaler.



STATUS
This behavior is by design.

Keywords: kbtshoot kbdcom kbprb kbclientserver KB926100

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.