Can't use the same JVMPI min=max heap setting for JVMTI

I have a DLL that serves as both PI and TI library. When using PI, I can specify -XmsNNNNm -XmxNNNNm but the same setting would not work when switching to TI. I must lower the heap setting by as much as 725M on a Windows box. On UNIX, I only need to lower it by 5-20M depending on machines. It does not matter when JVM 1.5 or 1.6 is used.

I do specify a base address for the Windows library.

Any help is appreciated.

[436 byte] By [bspikea] at [2007-11-27 8:25:54]
# 1

JVM TI agents are loaded before the heap is allocated whereas JVMPI agents are loaded after the heap is allocated. The issue is likely that after your DLL/agent is loaded it is not possible allocate a large contiguous region for the java heap. You will need to re-base your DLL to work around this.

alan.batemana at 2007-7-12 20:15:04 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Thanks, and I've done that but it still does not improve. For example, I've tried going from 0x71ad0000 to 0x78120000 (yes, not a suggested range according MS) and it did not help at all. To get the higher contiguous memory, I think rebasing my DLL alone is not sufficient.
bspikea at 2007-7-12 20:15:04 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

bspike, are you sure your DLL is actually getting loaded at the rebase address? The rebase address is just a hint; if the address space is occupied at DLL load time (maybe by another DLL), Windows will load your DLL somewhere else. I'm wondering if this could be happening in your case, and the DLL is getting loaded in a bad spot. I usually use vadump.exe (http://www.microsoft.com/downloads/details.aspx?FamilyID=3fe0961b-ea72-40eb-a052-f68bac5a8ec1&displaylang=en to print, for a particular process, where the DLLs actually get loaded:

c:\hotspot>vadump -sv -p 3624

Symbols loaded: 00400000 : 00AF6000 FIREFOX.EXE

Symbols loaded: 7C900000 : 7C9B0000 ntdll.dll

Symbols loaded: 7C800000 : 7C8F5000 kernel32.dll

Symbols loaded: 600B0000 : 60119000 js3250.dll

Symbols loaded: 60170000 : 60197000 nspr4.dll

....etc.

Even if it's not the specific problem I mentioned above, vadump might help diagnose the reason a large contiguous region isn't available.

Steve

sbohnea at 2007-7-12 20:15:04 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4
Using Process Explorer, I sure did verify that the Image Base and Base addresses are identical.
bspikea at 2007-7-12 20:15:04 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...