Re: Runtime.getRuntime().maxMemory() returns incredibly large value

"[email protected]" <[email protected]> Mon, 30 May 2016 14:28:10 +0000
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <SN1PR12MB041453A2A7FB3FE44BB606DF92450@SN1PR12MB0414.namprd12.prod.outlook.com>
Yes, from API perspective any long value is valid (even Long.MAX_VALUE of course) and should be handled correctly.
I will contact the OrientDB developers to point them to this issue.

I still have the side question if it is possible to somehow provide JVM command line parameters programmatically when using the converted DLLs?
For example, I would like to set the -XX:MaxDirectMemorySize parameter from within my code.

Thanks
Torsten


From: Volker Berlin [mailto:[email protected]]
Sent: Monday, May 30, 2016 4:05 PM
To: [email protected]
Subject: Re: [Ikvm-developers] Runtime.getRuntime().maxMemory() returns incredibly large value


The method returns  java.lang.Long.MAX_VALUE and this is correct for this API method. Take a look at the API docu. It look like a bug in your library.

Volker

Am 30.05.2016 um 15:24 schrieb [email protected]<mailto:[email protected]>:
Hi,
I converted OrientDB (https://github.com/orientechnologies/orientdb) current sources into a .NET dll using ikvmc tool (v 8.1.5717.0).
Unfortunately in the startup code of OrientDB code a check against Runtime.getRuntime().maxMemory() is made which returns a value of 9223372036854775807 for me.
This value is then used by the OrientDB code and fails with a NumberFormatException due to some call of integer.tryParse.

Interestingly running the original OrientDB jar files with java.exe does not exhibit the same exception, which is due to a much lower value returned by the Runtime.getRuntime().maxMemory()
call (something like 477102080).

So is there an explanation for the very large number returned by ikvm runtime? Is it a bug?

There would be a way to work around the exception throwing code in OrientDB if it would be possible to somehow provide JAVA runtime parameters like -XX:MaxDirectMemorySize=.
But this does not seem to be possible or did I miss something?

Thanks
Torsten

Agilent Technologies R&D and Marketing GmbH & Co. KG
Hewlett-Packard-Strasse 8 | 76337 Waldbronn

Tel: 07243 / 6022152
[email protected]<mailto:[email protected]>
www.agilent.com<http://www.agilent.com/>

[Logo_Signatur]

Agilent Technologies R&D and Marketing GmbH & Co. KG, Hewlett-Packard-Str. 8, 76337 Waldbronn
Sitz der Gesellschaft: Waldbronn - Amtsgericht Mannheim, HRA 706662
Persönlich haftende Gesellschafterin: Agilent Technologies R&D and Marketing Verwaltungs-GmbH,
Hewlett-Packard-Str. 8, 76337 Waldbronn
Sitz der persönlich haftenden Gesellschafterin: Waldbronn - Amtsgericht Mannheim, HRB 723933
Geschäftsführer: Dr. Stefan Schütte





------------------------------------------------------------------------------

What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic

patterns at an interface-level. Reveals which users, apps, and protocols are

consuming the most bandwidth. Provides multi-vendor support for NetFlow,

J-Flow, sFlow and other flows. Make informed decisions using capacity

planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e




_______________________________________________

Ikvm-developers mailing list

[email protected]<mailto:[email protected]>

https://lists.sourceforge.net/lists/listinfo/ikvm-developers

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e

_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
image001.jpg (image/jpeg, 2.1 KB) - not displayed