Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 17 Jan 2006 22:30:58 +0100,    group: microsoft.public.platformsdk.com_ole        back       


Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
I have an out-of-process COM object and I can not allocate in it more that 
1.1 G, even if the machine has 2G physical memory.
I am simply trying to call: malloc(1.3*1024*1024*1024) in the main method of 
the out-of-process COM object's executable.

The allocation succeeds only if I do it before I call CoInitializeEx and 
CoRegisterClassObject !!!

Before CoInitializeEx and CoRegisterClassObject I can allocate even 1.5G.
After them I can allocate maximum 1.1G


Parameters for CoInitializeEx: NULL, COINIT_MULTITHREADED
Parameters for CoRegisterClassObject: CLSID_MyDcom, pIFactory, 
CLSCTX_LOCAL_SERVER, REGCLS_SUSPENDED|REGCLS_MULTIPLEUSE, &dwRegister


Does anybody know the reason for this?
I would like to allocate this huge amount of memory leazy, but right now it 
seems that I must do it at the beginning :-( .
Is there an workaround for this ?

Stefan
date: Tue, 17 Jan 2006 22:30:58 +0100   author:   newsu lui bill

Re: Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
That's an interesting observation. What is the footprint size of the object 
itself? Does it allocate from the heap as well? Perhaps running perfmon and 
watching the pooled and non-pooled memory will give you some insight.

By the way, any application that demands this much RAM is a red flag that 
there are serious design issues.

Brian


"newsu lui bill"  wrote in message 
news:OCQ0P16GGHA.1424@TK2MSFTNGP12.phx.gbl...
>
> I have an out-of-process COM object and I can not allocate in it more that 
> 1.1 G, even if the machine has 2G physical memory.
> I am simply trying to call: malloc(1.3*1024*1024*1024) in the main method 
> of the out-of-process COM object's executable.
>
> The allocation succeeds only if I do it before I call CoInitializeEx and 
> CoRegisterClassObject !!!
>
> Before CoInitializeEx and CoRegisterClassObject I can allocate even 1.5G.
> After them I can allocate maximum 1.1G
>
>
> Parameters for CoInitializeEx: NULL, COINIT_MULTITHREADED
> Parameters for CoRegisterClassObject: CLSID_MyDcom, pIFactory, 
> CLSCTX_LOCAL_SERVER, REGCLS_SUSPENDED|REGCLS_MULTIPLEUSE, &dwRegister
>
>
> Does anybody know the reason for this?
> I would like to allocate this huge amount of memory leazy, but right now 
> it seems that I must do it at the beginning :-( .
> Is there an workaround for this ?
>
> Stefan
>
date: Tue, 17 Jan 2006 14:03:13 -0800   author:   Brian Muth

Re: Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
The COM object itself contains almost nothing.

Actually I need the memory for starting a "fat" Sun Java Virtual Machine and 
this operations fails when I give more than 1.1G. But forget the Java 
Virtual Machine, the same thing (memory allocation error) I get when I 
allocate the same amount of memory with a simple malloc.
The COM object is just a facade to another interface in the Java Virtual 
Machine.

I do not think that these details are relevant. Just take a small dummy 
"out-of-process" COM object and try to allocate with malloc 1.3G  in the 
main method its executable (after calling CoInitializeEx and 
CoRegisterClassObject) . The operation will fail , even if the system has 
enough physical meomory(in my case 2G).
Before CoInitializeEx and CoRegisterClassObject you can allocate the same 
amount of memory without any problem (actually I am able to allocate even 
1.5 G).

So the single question that remains: After the calling of CoInitializeEx and 
CoRegisterClassObject is there a limitation for the allocation of "normal" 
memory ???


"Brian Muth"  schrieb im Newsbeitrag 
news:uZ6pQH7GGHA.532@TK2MSFTNGP15.phx.gbl...
> That's an interesting observation. What is the footprint size of the 
> object itself? Does it allocate from the heap as well? Perhaps running 
> perfmon and watching the pooled and non-pooled memory will give you some 
> insight.
>
> By the way, any application that demands this much RAM is a red flag that 
> there are serious design issues.
>
> Brian
>
>
> "newsu lui bill"  wrote in message 
> news:OCQ0P16GGHA.1424@TK2MSFTNGP12.phx.gbl...
>>
>> I have an out-of-process COM object and I can not allocate in it more 
>> that 1.1 G, even if the machine has 2G physical memory.
>> I am simply trying to call: malloc(1.3*1024*1024*1024) in the main method 
>> of the out-of-process COM object's executable.
>>
>> The allocation succeeds only if I do it before I call CoInitializeEx and 
>> CoRegisterClassObject !!!
>>
>> Before CoInitializeEx and CoRegisterClassObject I can allocate even 1.5G.
>> After them I can allocate maximum 1.1G
>>
>>
>> Parameters for CoInitializeEx: NULL, COINIT_MULTITHREADED
>> Parameters for CoRegisterClassObject: CLSID_MyDcom, pIFactory, 
>> CLSCTX_LOCAL_SERVER, REGCLS_SUSPENDED|REGCLS_MULTIPLEUSE, &dwRegister
>>
>>
>> Does anybody know the reason for this?
>> I would like to allocate this huge amount of memory leazy, but right now 
>> it seems that I must do it at the beginning :-( .
>> Is there an workaround for this ?
>>
>> Stefan
>>
>
>
date: Wed, 18 Jan 2006 10:20:47 +0100   author:   newsu lui bill

Re: Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
I suspect this is related to the fact that you are asking for all the memory 
at once (ie. it is contiguous). Even a small allocation like a COM object 
may break up the heap so that the next largest contiguous allocation is 
1.1G.

Brian
date: Wed, 18 Jan 2006 10:07:39 -0800   author:   Brian Muth

Re: Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
I'm wondering if you might want to experiment with HeapCreate, HeapAlloc and 
related functions rather than malloc. This might give you better control 
over the memory allocation. If so, please post your results here. I'd be 
very interested to find out what you discover.

Brian
date: Wed, 18 Jan 2006 10:16:22 -0800   author:   Brian Muth

Re: Memory allocation limitation (~1.1G) in an "out-of-process" DCOM object ???   
I've experienced HeapCreate and HeapAlloc:

After calling CoInitializeEx and CoRegisterClassObject, the biggest value of 
the HeapCreate's maximum size (in order for HeapCreate to succeed) is the 
same with the maximum amount of memory that I can allocate with malloc 
(aprox 1.1-1.2 G).



Before calling CoInitializeEx and CoRegisterClassObject, both HeapCreate's 
maximum size and malloc's memory size can reach even 1.5-1.6G.



Regarding HeapAlloc, I can allocate only relative small quantities of 
memory - 200k (before as well after CoInitializeEx and 
CoRegisterClassObject).



>> Brian: I suspect this is related to the fact that you are asking for all 
>> the memory at once (ie. it is contiguous). Even a small allocation like a 
>> COM object may break up the heap so that the next largest contiguous 
>> allocation is 1.1G.

I am not really sure that the COM object breaks the heap.

I've also done the following experiment:

I started the COM object and, in parallel, I've started another process that 
succeeded to allocate (with malloc) 1.5G.

If what you suspect would be true, then the separate process should be able 
to allocate (with malloc) only 1.1G (exactly like the malloc called in the 
COM objects' process, after CoInitializeEx and CoRegisterClassObject).



So something smells a little bit fishy with the normal memory allocation in 
the COM objects' process (after the calls CoInitializeEx and 
CoRegisterClassObject)..



Stefan


"Brian Muth"  schrieb im Newsbeitrag 
news:ujPOKtFHGHA.1088@tk2msftngp13.phx.gbl...
> I'm wondering if you might want to experiment with HeapCreate, HeapAlloc 
> and related functions rather than malloc. This might give you better 
> control over the memory allocation. If so, please post your results here. 
> I'd be very interested to find out what you discover.
>
> Brian
>
date: Thu, 19 Jan 2006 17:15:14 +0100   author:   newsu lui bill

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us