X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Mar 2008 02:37 PM by  anon
How to increase JVM Heap Size for IDL-Java Bridge?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
25 Mar 2008 02:37 PM
    Hello All, I am having problem in increasing the heap size of the JVM when I call Java objects from IDL. By default it uses only 64MB, and hence cannot generate a large array on Java side. I tried to set the JVM start option in idljavabrc file: 'JVM Option1 = -Xms200M' 'JVM Option2 = -Xmx1G' but it doesnot work. IDL starts JVM with heap size of 64MB. I use following code to check the allocated heapsize for JVM oPublic = OBJ_NEW('IDLJavaObject$Static$JAVA_LANG_Runtime', 'java.lang.Runtime') a = oPublic->getRuntime(); print,a->availableProcessors() print,a->maxMemory() print,a->totalMemory() I am using IDL6.3 on WinXP-32 bit with 4Gb of physical RAM and /3GB switch on. Am I missing something in the IDL-JAVA Bridge configuration? Any help in this regards is appreciated Regards, Vijay

    Deleted User



    New Member


    Posts:
    New Member


    --
    25 Mar 2008 02:37 PM
    I post here the answer also provide through a Support Incident logged directly by Vijay with ITT Visual Information SolutionsTechnical Support: I just did experimentation in both IDL 6.3 and IDL 7.0 on Windows XP, and can conclude the following: 1) IDL definitely has implemented an explicit limit on how much max memory it will allow to the JVM child process that it spawns. Now in IDL 7.0 I can see how an explicit "Assertion failed" debug message is thrown when the max limit is overstepped. In IDL 6.3 I just experienced that my 'idlde' process simply exits without warning when the IDL-Java Import Bridge's 'idljavabrc' configuration file includes the statement: JVM Option2 = -Xmx1g 2) Another "show stopper" is the setting for "total memory". Clearly there is an unpublished default max value for heap memory. I believe it must be 64 MB. I notice that if one tries to set total memory beyond this default value with the JVM's '-Xms' flag, the IDL 7.0 'Assertion failed' message. Thus, a high '-Xms' assignment must be accompanied by a corresponding '-Xmx' assignment. 3) I got the following to work in both IDL 6.3 as well as IDL 7.0: JVM Option1 = -Xmx200m JVM Option2 = -Xmx512m 4) I think that the restrictions tied to the memory allocation for the Java Virtual Machine child process on 32-bit Windows are associated with the principles of memory on 32-bit Windows that are presented in ITT Visual Information Solutions Tech Tip #3346 ("Overcoming Windows Memory Allocation Limitations") at URL: http://www.ittvis.com/ser...echtip.asp?ttid=3346 Based on how large arrays might be passed/copied from the Java process to IDL's virtual memory, I suspect IDL developers had to make some choice about how to insure that IDL would be able to handle the "data transfer". 5) I would guess that your '/3GB' switch is ignored by the IDL-Java Import Bridge. Is it possibly also ignored by IDL? Are you, for example, able to run these commands in a fresh new IDL 6.3 session? IDL> nBytes = 2LL^31 ; 2GB IDL> var = bytarr(nBytes, /NOZERO) If no, what IS the maximum byte array that you can allocate in a brand new IDLDE session? That covers this topic, I hope. Denise Goldstein talked to me earlier today and made me think you may have some other topics as well ... for example, multithreading in IDL. Feel free to give me a call if you have questions about this JVM subject covered in this Email, or any other subjects. James Jones ITT Technical Support
    You are not authorized to post a reply.