You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/06/02 10:39:07 UTC

maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Hi,

I've noticed we've hard coded the jvm max memory to:

SET MAVEN_DEFAULT_OPTS="-Xmx160m"

I need to adjust this memory to a greater value and I think it would be
nice to let users do this *without* having to modify the maven.bat file
every time a new version of maven is downloaded.

I suggest removing the "SET MAVEN_DEFAULT_OPTS="-Xmx160m" line
altogether (and thus remove the MAVEN_DEFAULT_OPTS variable). 

Any objections?

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by di...@multitask.com.au.
+1 from me
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


"Vincent Massol" <vm...@pivolis.com> wrote on 03/06/2003 06:58:34 PM:

> 
> 
> > -----Original Message-----
> > From: Matt Johnson [mailto:johnsonm@whitesmiths.com.au]
> > Sent: 03 June 2003 10:41
> > To: Maven Developers List
> > Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> > 
> > How 'bout just defaulting MAVEN_OPTS if and only if it ain't already
> set
> > (see attached diff).  This basically abolishes MAVEN_DEFAULT_OPTS and
> > sets MAVEN_OPTS if it's not already set.  If the user sets it at all,
> it
> > overrides the -Xmx160m.
> 
> I think it is a step forward and I could live with this. It is not
> perfect in the sense that it does not perform a real "merge" of
> MAVEN_OPTS and MAVEN_DEFAULT_OPTS params but I think it is good enough
> and is certainly the easiest solution.
> 
> dIon, what do you think? Can I commit this?
> 
> Thanks
> -Vincent
> 
> > 
> > (Disclaimer: Works On My Machine)
> > 
> > 
> > Matt
> > 
> > Vincent Massol wrote:
> > 
> > >
> > >
> > >>-----Original Message-----
> > >>From: news [mailto:news@main.gmane.org] On Behalf Of dIon Gillard
> > >>Sent: 03 June 2003 04:20
> > >>To: dev@maven.apache.org
> > >>Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> > >>
> > >>Vincent Massol wrote:
> > >>
> > >>
> > >>
> > >>>>Isn't this what MAVEN_OPTS is for?
> > >>>>
> > >>>>The user can set stuff in MAVEN_OPTS and override the defaults....
> > >>>>
> > >>>>
> > >>>hum... are you saying that the following works:
> > >>>
> > >>>java -Xmx160m -Xmx256m [...]
> > >>>
> > >>>?
> > >>>
> > >>>Even if it works, it doesn't look like a valid solution but more
> > >>>
> > >>>
> > >like a
> > >
> > >
> > >>>trick to me. What do you think?
> > >>>
> > >>>
> > >>I think I was the one that changed the batch file to use
> > >>MAVEN_DEFAULT_OPTS and MAVEN_OPTS, and I wasn't trying to be tricky,
> I
> > >>was trying to get a solution.
> > >>
> > >>It seemed to work for me, so I committed it. It also allows running
> of
> > >>maven in a debugger etc, so I'd rather not get rid of the
> > >>
> > >>
> > >functionality.
> > >
> > >Ok. I don't think you get me. I'm not saying to get rid of
> MAVEN_OPTS,
> > >quite the opposite. This is excellent and suit my need.
> > >
> > >What I would like to get rid of, is the MAVEN_DEFAULT_OPTS because it
> is
> > >set with the arbitrary value "-Xmx160m".
> > >
> > >Let me explain even more... In maven.bat, there is:
> > >
> > >%MAVEN_JAVA_EXE% [...]%MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS%
> %MAVEN_OPTS%
> > >[...]
> > >
> > >So, if I set my MAVEN_OPTS environment variable to be "-Xmx256m" for
> > >example, the command line will look like:
> > >
> > >java [...] -Xmx160m -Xmx256m [...]
> > >
> > >and I don't recall a rule of the "java" executable saying that it is
> > >allowed to have the same parameter twice on the command line and that
> > >the second one will be used! I may be wrong, in which case, please
> point
> > >me to the documentation :-)
> > >
> > >
> > >
> > >>Normally maven site wont work without a fair chunk of memory, and
> the
> > >>defaults didn't work, hence MAVEN_DEFAULT_OPTS.
> > >>
> > >>
> > >
> > >This is exactly the reason I need to override it! 160m is really too
> low
> > >for our reactor. It needs over 1GB! (we have several hundreds of
> > >projects and we've had to run them by chunks).
> > >
> > >Thus this magical number will maybe solve the problem for *you* but
> not
> > >for everyone. So I see 2 solutions:
> > >
> > >- remove the MAVEN_DEFAULT_OPTS and let the user augment the memory
> if
> > >the default 64m is not enough
> > >- somehow verify if -Xmx is in MAVEN_OPTS and if so remove it from
> > >MAVEN_DEFAULT_OPTS (same for any other parameter).
> > >
> > >
> > >
> > >>Back to the original point, I can't see why the user should have to
> > >>change the batch file....
> > >>
> > >>
> > >
> > >For the reason above... :-)
> > >
> > >I hope it is clearer now.
> > >
> > >Thanks
> > >-Vincent
> > >
> > >
> > >
> > >>--
> > >>dIon Gillard, Multitask Consulting
> > >>Blog:      http://www.freeroller.net/page/dion/Weblog
> > >>Work:      http://www.multitask.com.au
> > >>
> > >>
> > >>
> >
> >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >>For additional commands, e-mail: dev-help@maven.apache.org
> > >>
> > >>
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> > >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Matt Johnson [mailto:johnsonm@whitesmiths.com.au]
> Sent: 03 June 2003 10:41
> To: Maven Developers List
> Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> 
> How 'bout just defaulting MAVEN_OPTS if and only if it ain't already
set
> (see attached diff).  This basically abolishes MAVEN_DEFAULT_OPTS and
> sets MAVEN_OPTS if it's not already set.  If the user sets it at all,
it
> overrides the -Xmx160m.

I think it is a step forward and I could live with this. It is not
perfect in the sense that it does not perform a real "merge" of
MAVEN_OPTS and MAVEN_DEFAULT_OPTS params but I think it is good enough
and is certainly the easiest solution.

dIon, what do you think? Can I commit this?

Thanks
-Vincent

> 
> (Disclaimer: Works On My Machine)
> 
> 
> Matt
> 
> Vincent Massol wrote:
> 
> >
> >
> >>-----Original Message-----
> >>From: news [mailto:news@main.gmane.org] On Behalf Of dIon Gillard
> >>Sent: 03 June 2003 04:20
> >>To: dev@maven.apache.org
> >>Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> >>
> >>Vincent Massol wrote:
> >>
> >>
> >>
> >>>>Isn't this what MAVEN_OPTS is for?
> >>>>
> >>>>The user can set stuff in MAVEN_OPTS and override the defaults....
> >>>>
> >>>>
> >>>hum... are you saying that the following works:
> >>>
> >>>java -Xmx160m -Xmx256m [...]
> >>>
> >>>?
> >>>
> >>>Even if it works, it doesn't look like a valid solution but more
> >>>
> >>>
> >like a
> >
> >
> >>>trick to me. What do you think?
> >>>
> >>>
> >>I think I was the one that changed the batch file to use
> >>MAVEN_DEFAULT_OPTS and MAVEN_OPTS, and I wasn't trying to be tricky,
I
> >>was trying to get a solution.
> >>
> >>It seemed to work for me, so I committed it. It also allows running
of
> >>maven in a debugger etc, so I'd rather not get rid of the
> >>
> >>
> >functionality.
> >
> >Ok. I don't think you get me. I'm not saying to get rid of
MAVEN_OPTS,
> >quite the opposite. This is excellent and suit my need.
> >
> >What I would like to get rid of, is the MAVEN_DEFAULT_OPTS because it
is
> >set with the arbitrary value "-Xmx160m".
> >
> >Let me explain even more... In maven.bat, there is:
> >
> >%MAVEN_JAVA_EXE% [...]%MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS%
%MAVEN_OPTS%
> >[...]
> >
> >So, if I set my MAVEN_OPTS environment variable to be "-Xmx256m" for
> >example, the command line will look like:
> >
> >java [...] -Xmx160m -Xmx256m [...]
> >
> >and I don't recall a rule of the "java" executable saying that it is
> >allowed to have the same parameter twice on the command line and that
> >the second one will be used! I may be wrong, in which case, please
point
> >me to the documentation :-)
> >
> >
> >
> >>Normally maven site wont work without a fair chunk of memory, and
the
> >>defaults didn't work, hence MAVEN_DEFAULT_OPTS.
> >>
> >>
> >
> >This is exactly the reason I need to override it! 160m is really too
low
> >for our reactor. It needs over 1GB! (we have several hundreds of
> >projects and we've had to run them by chunks).
> >
> >Thus this magical number will maybe solve the problem for *you* but
not
> >for everyone. So I see 2 solutions:
> >
> >- remove the MAVEN_DEFAULT_OPTS and let the user augment the memory
if
> >the default 64m is not enough
> >- somehow verify if -Xmx is in MAVEN_OPTS and if so remove it from
> >MAVEN_DEFAULT_OPTS (same for any other parameter).
> >
> >
> >
> >>Back to the original point, I can't see why the user should have to
> >>change the batch file....
> >>
> >>
> >
> >For the reason above... :-)
> >
> >I hope it is clearer now.
> >
> >Thanks
> >-Vincent
> >
> >
> >
> >>--
> >>dIon Gillard, Multitask Consulting
> >>Blog:      http://www.freeroller.net/page/dion/Weblog
> >>Work:      http://www.multitask.com.au
> >>
> >>
> >>
>
>>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by Matt Johnson <jo...@whitesmiths.com.au>.
How 'bout just defaulting MAVEN_OPTS if and only if it ain't already set 
(see attached diff).  This basically abolishes MAVEN_DEFAULT_OPTS and 
sets MAVEN_OPTS if it's not already set.  If the user sets it at all, it 
overrides the -Xmx160m.

(Disclaimer: Works On My Machine)


Matt

Vincent Massol wrote:

>  
>
>>-----Original Message-----
>>From: news [mailto:news@main.gmane.org] On Behalf Of dIon Gillard
>>Sent: 03 June 2003 04:20
>>To: dev@maven.apache.org
>>Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
>>
>>Vincent Massol wrote:
>>
>>    
>>
>>>>Isn't this what MAVEN_OPTS is for?
>>>>
>>>>The user can set stuff in MAVEN_OPTS and override the defaults....
>>>>        
>>>>
>>>hum... are you saying that the following works:
>>>
>>>java -Xmx160m -Xmx256m [...]
>>>
>>>?
>>>
>>>Even if it works, it doesn't look like a valid solution but more
>>>      
>>>
>like a
>  
>
>>>trick to me. What do you think?
>>>      
>>>
>>I think I was the one that changed the batch file to use
>>MAVEN_DEFAULT_OPTS and MAVEN_OPTS, and I wasn't trying to be tricky, I
>>was trying to get a solution.
>>
>>It seemed to work for me, so I committed it. It also allows running of
>>maven in a debugger etc, so I'd rather not get rid of the
>>    
>>
>functionality.
>
>Ok. I don't think you get me. I'm not saying to get rid of MAVEN_OPTS,
>quite the opposite. This is excellent and suit my need.
>
>What I would like to get rid of, is the MAVEN_DEFAULT_OPTS because it is
>set with the arbitrary value "-Xmx160m".
>
>Let me explain even more... In maven.bat, there is:
>
>%MAVEN_JAVA_EXE% [...]%MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS%
>[...]
>
>So, if I set my MAVEN_OPTS environment variable to be "-Xmx256m" for
>example, the command line will look like:
>
>java [...] -Xmx160m -Xmx256m [...]
>
>and I don't recall a rule of the "java" executable saying that it is
>allowed to have the same parameter twice on the command line and that
>the second one will be used! I may be wrong, in which case, please point
>me to the documentation :-)
>
>  
>
>>Normally maven site wont work without a fair chunk of memory, and the
>>defaults didn't work, hence MAVEN_DEFAULT_OPTS.
>>    
>>
>
>This is exactly the reason I need to override it! 160m is really too low
>for our reactor. It needs over 1GB! (we have several hundreds of
>projects and we've had to run them by chunks).
>
>Thus this magical number will maybe solve the problem for *you* but not
>for everyone. So I see 2 solutions:
>
>- remove the MAVEN_DEFAULT_OPTS and let the user augment the memory if
>the default 64m is not enough
>- somehow verify if -Xmx is in MAVEN_OPTS and if so remove it from
>MAVEN_DEFAULT_OPTS (same for any other parameter).
>
>  
>
>>Back to the original point, I can't see why the user should have to
>>change the batch file....
>>    
>>
>
>For the reason above... :-)
>
>I hope it is clearer now.
>
>Thanks
>-Vincent
>
>  
>
>>--
>>dIon Gillard, Multitask Consulting
>>Blog:      http://www.freeroller.net/page/dion/Weblog
>>Work:      http://www.multitask.com.au
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>  
>

RE: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: news [mailto:news@main.gmane.org] On Behalf Of dIon Gillard
> Sent: 03 June 2003 04:20
> To: dev@maven.apache.org
> Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> 
> Vincent Massol wrote:
> 
> >>Isn't this what MAVEN_OPTS is for?
> >>
> >>The user can set stuff in MAVEN_OPTS and override the defaults....
> >
> >
> > hum... are you saying that the following works:
> >
> > java -Xmx160m -Xmx256m [...]
> >
> > ?
> >
> > Even if it works, it doesn't look like a valid solution but more
like a
> > trick to me. What do you think?
> I think I was the one that changed the batch file to use
> MAVEN_DEFAULT_OPTS and MAVEN_OPTS, and I wasn't trying to be tricky, I
> was trying to get a solution.
> 
> It seemed to work for me, so I committed it. It also allows running of
> maven in a debugger etc, so I'd rather not get rid of the
functionality.

Ok. I don't think you get me. I'm not saying to get rid of MAVEN_OPTS,
quite the opposite. This is excellent and suit my need.

What I would like to get rid of, is the MAVEN_DEFAULT_OPTS because it is
set with the arbitrary value "-Xmx160m".

Let me explain even more... In maven.bat, there is:

%MAVEN_JAVA_EXE% [...]%MAVEN_ENDORSED% %MAVEN_DEFAULT_OPTS% %MAVEN_OPTS%
[...]

So, if I set my MAVEN_OPTS environment variable to be "-Xmx256m" for
example, the command line will look like:

java [...] -Xmx160m -Xmx256m [...]

and I don't recall a rule of the "java" executable saying that it is
allowed to have the same parameter twice on the command line and that
the second one will be used! I may be wrong, in which case, please point
me to the documentation :-)

> 
> Normally maven site wont work without a fair chunk of memory, and the
> defaults didn't work, hence MAVEN_DEFAULT_OPTS.

This is exactly the reason I need to override it! 160m is really too low
for our reactor. It needs over 1GB! (we have several hundreds of
projects and we've had to run them by chunks).

Thus this magical number will maybe solve the problem for *you* but not
for everyone. So I see 2 solutions:

- remove the MAVEN_DEFAULT_OPTS and let the user augment the memory if
the default 64m is not enough
- somehow verify if -Xmx is in MAVEN_OPTS and if so remove it from
MAVEN_DEFAULT_OPTS (same for any other parameter).

> 
> Back to the original point, I can't see why the user should have to
> change the batch file....

For the reason above... :-)

I hope it is clearer now.

Thanks
-Vincent

> --
> dIon Gillard, Multitask Consulting
> Blog:      http://www.freeroller.net/page/dion/Weblog
> Work:      http://www.multitask.com.au
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by dIon Gillard <di...@multitask.com.au>.
Vincent Massol wrote:

>>Isn't this what MAVEN_OPTS is for?
>>
>>The user can set stuff in MAVEN_OPTS and override the defaults....
> 
> 
> hum... are you saying that the following works:
> 
> java -Xmx160m -Xmx256m [...]
> 
> ?
> 
> Even if it works, it doesn't look like a valid solution but more like a
> trick to me. What do you think?
I think I was the one that changed the batch file to use 
MAVEN_DEFAULT_OPTS and MAVEN_OPTS, and I wasn't trying to be tricky, I 
was trying to get a solution.

It seemed to work for me, so I committed it. It also allows running of 
maven in a debugger etc, so I'd rather not get rid of the functionality.

Normally maven site wont work without a fair chunk of memory, and the 
defaults didn't work, hence MAVEN_DEFAULT_OPTS.

Back to the original point, I can't see why the user should have to 
change the batch file....
-- 
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: news [mailto:news@main.gmane.org] On Behalf Of dIon Gillard
> Sent: 02 June 2003 16:56
> To: dev@maven.apache.org
> Subject: Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?
> 
> Isn't this what MAVEN_OPTS is for?
> 
> The user can set stuff in MAVEN_OPTS and override the defaults....

hum... are you saying that the following works:

java -Xmx160m -Xmx256m [...]

?

Even if it works, it doesn't look like a valid solution but more like a
trick to me. What do you think?

Thanks
-Vincent

> 
> dIon
> 
> Vincent Massol wrote:
> > Hi,
> >
> > I've noticed we've hard coded the jvm max memory to:
> >
> > SET MAVEN_DEFAULT_OPTS="-Xmx160m"
> >
> > I need to adjust this memory to a greater value and I think it would
be
> > nice to let users do this *without* having to modify the maven.bat
file
> > every time a new version of maven is downloaded.
> >
> > I suggest removing the "SET MAVEN_DEFAULT_OPTS="-Xmx160m" line
> > altogether (and thus remove the MAVEN_DEFAULT_OPTS variable).
> >
> > Any objections?
> >
> > Thanks
> > -Vincent
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: maven.bat and -Xmx, remove MAVEN_DEFAULT_OPTS?

Posted by dIon Gillard <di...@multitask.com.au>.
Isn't this what MAVEN_OPTS is for?

The user can set stuff in MAVEN_OPTS and override the defaults....

dIon

Vincent Massol wrote:
> Hi,
> 
> I've noticed we've hard coded the jvm max memory to:
> 
> SET MAVEN_DEFAULT_OPTS="-Xmx160m"
> 
> I need to adjust this memory to a greater value and I think it would be
> nice to let users do this *without* having to modify the maven.bat file
> every time a new version of maven is downloaded.
> 
> I suggest removing the "SET MAVEN_DEFAULT_OPTS="-Xmx160m" line
> altogether (and thus remove the MAVEN_DEFAULT_OPTS variable). 
> 
> Any objections?
> 
> Thanks
> -Vincent



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org