[Info-vax] help needed diagnosing/debugging java.lang.OutOfMemoryError
Arne Vajhøj
arne at vajhoej.dk
Thu Aug 18 17:54:43 EDT 2011
On 8/18/2011 5:47 PM, Arne Vajhøj wrote:
> On 8/18/2011 5:15 PM, Arne Vajhøj wrote:
>> On 8/18/2011 8:43 AM, VAXman- @SendSpamHere.ORG wrote:
>>> In article<4e4c6bba$0$308$14726298 at news.sunsite.dk>,
>>> =?ISO-8859-1?Q?Arne_Vajh=F8j?=<arne at vajhoej.dk> writes:
>>>> On 8/17/2011 8:23 AM, VAXman- @SendSpamHere.ORG wrote:
>>>>> In article<4e4b2601$0$314$14726298 at news.sunsite.dk>,
>>>>> =?ISO-8859-1?Q?Arne_Vajh=F8j?=<arne at vajhoej.dk> writes:
>>>>>> On 8/16/2011 9:59 PM, VAXman- @SendSpamHere.ORG wrote:
>>>>>>> In article<4e4b055e$0$314$14726298 at news.sunsite.dk>,
>>>>>>> =?ISO-8859-1?Q?Arne_Vajh=F8j?=<arne at vajhoej.dk> writes:
>>>>>>>> On 8/16/2011 9:07 AM, VAXman- @SendSpamHere.ORG wrote:
>>>>>>>>> In article<4e49c081$0$314$14726298 at news.sunsite.dk>,
>>>>>>>>> =?ISO-8859-1?Q?Arne_Vajh=F8j?=<arne at vajhoej.dk> writes:
>>>>>>>>>> On 8/15/2011 8:43 PM, VAXman- @SendSpamHere.ORG wrote:
>>>>>>>>>>> In article<4e4994ad$0$312$14726298 at news.sunsite.dk>,
>>>>>>>>>>> =?ISO-8859-1?Q?Arne_Vajh=F8j?=<arne at vajhoej.dk> writes:
>>>>>>>>>>>> On 8/15/2011 2:11 PM, VAXman- @SendSpamHere.ORG wrote:
>>>>>>>>>>>>> What the subject says...
>>>>>>>>>>>>>
>>>>>>>>>>>>> An application in development for use on an OpenVMS system
>>>>>>>>>>>>> is tossing up
>>>>>>>>>>>>> this error. I've increased the page file quota for
>>>>>>>>>>>>> APACHE$WWW to 1M and
>>>>>>>>>>>>> there is still this error. The logs produced by this Java
>>>>>>>>>>>>> stuff do not
>>>>>>>>>>>>> tell much. Is there some way to get a dump or more logging?
>>>>>>>>>>>>>
>>>>>>>>>>>>> PS. I don't do Java (unless it's in my coffee mug) and thus,
>>>>>>>>>>>>> I'm not the
>>>>>>>>>>>>> one developing the app.
>>>>>>>>>>>>
>>>>>>>>>>>> First: 512 MB is not that much today.
>>>>>>>>>>>>
>>>>>>>>>>>> Second: what value does the -Xmx option for the java command?
>>>>>>>>>>>> (it also
>>>>>>>>>>>> limits the maximum memory that can be allocated)
>>>>>>>>>>>
>>>>>>>>>>> Well, it pukes with -Xmx384m
>>>>>>>>>>
>>>>>>>>>> Then try 512m 768m 1024m (and make sure that there is backing
>>>>>>>>>> for it).
>>>>>>>>>
>>>>>>>>> The STARTUP pukes @ -Xmx384m complaining about memory.
>>>>>>>>
>>>>>>>> Does the account starting the app have more
>>>>>>>> than 384 MB available (page file quota)?
>>>>>>>
>>>>>>> SYSTEM account has 2000000 on this particular machine. That's a
>>>>>>> gig in
>>>>>>> my book.
>>>>>>
>>>>>> Yup.
>>>>>>
>>>>>> What exactly does "pukes" mean?
>>>>>
>>>>> the out of memory errors.
>>>>>
>>>>>> And what Java version?
>>>>>
>>>>> 1.5.07 This is on Alpha.
>>>>
>>>> Does it run with 768m?
>>>
>>> If Java won't start with more than 256m and the application pukes on
>>> that,
>>> there's little chance of 768m.
>>
>> ????
>>
>> java.lang.OutOfMemoryError means that the apps code can not allocate
>> the desired memory from the Java heap.
>>
>> Xmx limits the size of the Java heap.
>>
>> So in case of java.lang.OutOfMemoryError the first thing to try is to
>> increase Xmx.
>>
>> If the JVM can not get Xmx from VMS, then you will get a different
>> type of error.
>
> Example:
>
> $ type mm.java
> public class MM {
> public static void main(String[] args) {
> try {
> int n = Integer.parseInt(args[0]);
> System.out.println(n + " MB");
> byte[] b = new byte[n*1024*1024];
> System.out.println("It works");
> } catch(Throwable t) {
> System.out.println(t);
> }
> }
> }
> $ javac mm.java
> $ java "-Xmx50m" "MM" 100
> 100 MB
> java.lang.OutOfMemoryError
> $ java "-Xmx150m" "MM" 100
> 100 MB
> It works
> $ java "-Xmx1500m" "MM" 100
> -Xmx1500m: value out of range 8192..943718400
> Could not create the Java virtual machine.
All this is as expected.
But this puzzles me:
$ java "-Xmx750m" "MM" 250
250 MB
java.lang.OutOfMemoryError
But it must be because I have a page file quota
of just 256 MB.
(note: Java uses memory for a lot of other things than heap)
Arne
More information about the Info-vax
mailing list