generations

Java process memory check test

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to see how -Xmx and -Xms parameters impact on my program and check how much memory does my process consume. I wrote a simple program but am not able to reason out the results. Kindly help. public static void main( String[] args ) { char[] array = new char[69926904]; } I ran with parameters -Xms5M -Xmx200M . Ideally, since a character takes 2 bytes, it should hold 100M characters before exceeding the memory limit. Even if we say, few space is getting used for pointer and length , I don't know, why it is throwing error after 69926904