You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ritesh Trivedi <ri...@gmail.com> on 2006/05/09 02:40:46 UTC
Re: Memory Leak on Solaris?
Hi,
I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
calling and executing Ant target from within my java program. I am
seeing Out Of Memory errors on Solaris on Windows 2000 it works
perfectly fine - no leaks.
Any advise or pointers?
Thanks
Ritesh
On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
> Hi,
>
> I am experiencing memory leak while executing Ant targets multiple
> times from java program. It seems to me that the classloader instances
> are lying around and takes heap space for each run.
>
> Any fixes for the issue?
>
> Thanks
> Ritesh
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Automated Cvs Merge
Posted by "Row M, Vishal" <vi...@hp.com>.
Hi All
Is there any task that merges multiple vendor branches in CVS into
the main branch.
Please let me know.
Thanks
Vishal
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Memory Leak on Solaris?
Posted by James Abley <ja...@volantis.com>.
Hi Ritesh,
Have you profiled your application?
Cheers,
James
Scot P. Floess wrote:
> Ritesh:
>
> In just examining your code fragment, it wouldn't appear you are doing
> anything out of the ordinary (to cause a memory leak). At a high level,
> what does this app do specifically? Perhaps the failure is in another
> part of of your app (causing the out-of-memory issue)? Is it possible,
> for instance, you are caching data in such a way that under Solaris
> there is more data and, for whatever reason, less data under Windows? I
> could see a such a scenario where maybe on the Solaris machine you go
> seek out all files starting in / and store in an array, but under
> Windows you start in some other directory which yields a much smaller
> array - again just an example. For the most part you state Solaris runs
> out of memory but its still hard to determine how "exact" your
> environment is between Solaris and Windows and what your app does.
>
> Something else too...I would -hope- that your java app isn't somehow
> doing one thing for Windows and another for Solaris. It looks like your
> are running Sun's VM for both Windows and Solaris. With that said, I
> would expect the Solaris version to be the same, or better, than the
> Windows implementation ;)
>
> Scot
>
> Ritesh Trivedi wrote:
>
>> I am starting my app from command line
>>
>> e.g. java [OPTIONS] -jar myjar.jar [my commandline args]
>>
>> I have tried both, with and without Xms and Xmx options. It still leaks.
>>
>> My app basically "executes" ant targets from within the app (cant
>> really mention what app does). I am using the following code fragment
>> to execute ant target
>>
>> Project project = new Project();
>> ProjectHelper helper = null;
>> DefaultLogger logger = new DefaultLogger();
>>
>> logger.setMessageOutputLevel(Project.MSG_INFO);
>> logger.setOutputPrintStream(System.out);
>> logger.setErrorPrintStream(System.err);
>> project.addBuildListener(logger);
>>
>> File buildFile = new File(buildFilePath);
>> Throwable exception = null;
>>
>> try
>> {
>> project.fireBuildStarted();
>> project.init();
>>
>> helper = ProjectHelper.getProjectHelper();
>> String[] properties = getPropertyNames();
>>
>> if (_log.isDebugEnabled())
>> LangUtil.printArray(" Combined Properties ", properties);
>>
>> if (!LangUtil.isEmptyOrNull(properties))
>> {
>> int numProperties = properties.length;
>>
>> for(int i=0; i<numProperties; i++)
>> project.setProperty(properties[i],
>> getPropertyValue(properties[i]).toString());
>> }
>> helper.parse(project, buildFile);
>>
>> if (StringUtil.isEmptyOrNull(target))
>> project.executeTarget(project.getDefaultTarget());
>> else
>> project.executeTarget(target);
>>
>>
>> setProperties(project.getProperties());
>> }
>> catch (Exception bex)
>> {
>> exception = bex;
>> _error = true;
>> if (_log.isErrorEnabled())
>> _log.error("Error processing build script " +
>> bex.toString());
>> }
>> finally
>> {
>> if (project != null)
>> {
>> project.fireBuildFinished(exception);
>> project.removeBuildListener(logger);
>> logger = null;
>> project = null;
>> }
>> helper = null;
>> }
>>
>>> How are you starting your java app? Are you using any memory options?
>>> What does your app do? Sorta difficult to say for sure without more
>>> information.
>>
>>
>> Ritesh Trivedi wrote:
>>
>>> Hi,
>>>
>>> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
>>> calling and executing Ant target from within my java program. I am
>>> seeing Out Of Memory errors on Solaris on Windows 2000 it works
>>> perfectly fine - no leaks.
>>>
>>> Any advise or pointers?
>>>
>>> Thanks
>>> Ritesh
>>>
>>> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am experiencing memory leak while executing Ant targets multiple
>>>> times from java program. It seems to me that the classloader instances
>>>> are lying around and takes heap space for each run.
>>>>
>>>> Any fixes for the issue?
>>>>
>>>> Thanks
>>>> Ritesh
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>> --
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC 27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (Work)
>>
>> Chief Architect JPlate http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>>
>>
>>
>> On 5/8/06, Ritesh Trivedi <ri...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
>>> calling and executing Ant target from within my java program. I am
>>> seeing Out Of Memory errors on Solaris on Windows 2000 it works
>>> perfectly fine - no leaks.
>>>
>>> Any advise or pointers?
>>>
>>> Thanks
>>> Ritesh
>>>
>>> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > I am experiencing memory leak while executing Ant targets multiple
>>> > times from java program. It seems to me that the classloader instances
>>> > are lying around and takes heap space for each run.
>>> >
>>> > Any fixes for the issue?
>>> >
>>> > Thanks
>>> > Ritesh
>>> >
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Memory Leak on Solaris?
Posted by "Scot P. Floess" <fl...@mindspring.com>.
Ritesh:
In just examining your code fragment, it wouldn't appear you are doing
anything out of the ordinary (to cause a memory leak). At a high level,
what does this app do specifically? Perhaps the failure is in another
part of of your app (causing the out-of-memory issue)? Is it possible,
for instance, you are caching data in such a way that under Solaris
there is more data and, for whatever reason, less data under Windows? I
could see a such a scenario where maybe on the Solaris machine you go
seek out all files starting in / and store in an array, but under
Windows you start in some other directory which yields a much smaller
array - again just an example. For the most part you state Solaris runs
out of memory but its still hard to determine how "exact" your
environment is between Solaris and Windows and what your app does.
Something else too...I would -hope- that your java app isn't somehow
doing one thing for Windows and another for Solaris. It looks like your
are running Sun's VM for both Windows and Solaris. With that said, I
would expect the Solaris version to be the same, or better, than the
Windows implementation ;)
Scot
Ritesh Trivedi wrote:
> I am starting my app from command line
>
> e.g. java [OPTIONS] -jar myjar.jar [my commandline args]
>
> I have tried both, with and without Xms and Xmx options. It still leaks.
>
> My app basically "executes" ant targets from within the app (cant
> really mention what app does). I am using the following code fragment
> to execute ant target
>
> Project project = new Project();
> ProjectHelper helper = null;
> DefaultLogger logger = new DefaultLogger();
>
> logger.setMessageOutputLevel(Project.MSG_INFO);
> logger.setOutputPrintStream(System.out);
> logger.setErrorPrintStream(System.err);
> project.addBuildListener(logger);
>
> File buildFile = new File(buildFilePath);
> Throwable exception = null;
>
> try
> {
> project.fireBuildStarted();
> project.init();
>
> helper = ProjectHelper.getProjectHelper();
> String[] properties = getPropertyNames();
>
> if (_log.isDebugEnabled())
> LangUtil.printArray(" Combined Properties ", properties);
>
> if (!LangUtil.isEmptyOrNull(properties))
> {
> int numProperties = properties.length;
>
> for(int i=0; i<numProperties; i++)
> project.setProperty(properties[i],
> getPropertyValue(properties[i]).toString());
> }
> helper.parse(project, buildFile);
>
> if (StringUtil.isEmptyOrNull(target))
> project.executeTarget(project.getDefaultTarget());
> else
> project.executeTarget(target);
>
>
> setProperties(project.getProperties());
> }
> catch (Exception bex)
> {
> exception = bex;
> _error = true;
> if (_log.isErrorEnabled())
> _log.error("Error processing build script " +
> bex.toString());
> }
> finally
> {
> if (project != null)
> {
> project.fireBuildFinished(exception);
> project.removeBuildListener(logger);
> logger = null;
> project = null;
> }
> helper = null;
> }
>
>> How are you starting your java app? Are you using any memory options?
>> What does your app do? Sorta difficult to say for sure without more
>> information.
>
> Ritesh Trivedi wrote:
>> Hi,
>>
>> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
>> calling and executing Ant target from within my java program. I am
>> seeing Out Of Memory errors on Solaris on Windows 2000 it works
>> perfectly fine - no leaks.
>>
>> Any advise or pointers?
>>
>> Thanks
>> Ritesh
>>
>> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>>> Hi,
>>>
>>> I am experiencing memory leak while executing Ant targets multiple
>>> times from java program. It seems to me that the classloader instances
>>> are lying around and takes heap space for each run.
>>>
>>> Any fixes for the issue?
>>>
>>> Thanks
>>> Ritesh
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> --
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
>
>
> On 5/8/06, Ritesh Trivedi <ri...@gmail.com> wrote:
>> Hi,
>>
>> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
>> calling and executing Ant target from within my java program. I am
>> seeing Out Of Memory errors on Solaris on Windows 2000 it works
>> perfectly fine - no leaks.
>>
>> Any advise or pointers?
>>
>> Thanks
>> Ritesh
>>
>> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>> > Hi,
>> >
>> > I am experiencing memory leak while executing Ant targets multiple
>> > times from java program. It seems to me that the classloader instances
>> > are lying around and takes heap space for each run.
>> >
>> > Any fixes for the issue?
>> >
>> > Thanks
>> > Ritesh
>> >
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Memory Leak on Solaris?
Posted by Ritesh Trivedi <ri...@gmail.com>.
I am starting my app from command line
e.g. java [OPTIONS] -jar myjar.jar [my commandline args]
I have tried both, with and without Xms and Xmx options. It still leaks.
My app basically "executes" ant targets from within the app (cant
really mention what app does). I am using the following code fragment
to execute ant target
Project project = new Project();
ProjectHelper helper = null;
DefaultLogger logger = new DefaultLogger();
logger.setMessageOutputLevel(Project.MSG_INFO);
logger.setOutputPrintStream(System.out);
logger.setErrorPrintStream(System.err);
project.addBuildListener(logger);
File buildFile = new File(buildFilePath);
Throwable exception = null;
try
{
project.fireBuildStarted();
project.init();
helper = ProjectHelper.getProjectHelper();
String[] properties = getPropertyNames();
if (_log.isDebugEnabled())
LangUtil.printArray(" Combined Properties ", properties);
if (!LangUtil.isEmptyOrNull(properties))
{
int numProperties = properties.length;
for(int i=0; i<numProperties; i++)
project.setProperty(properties[i],
getPropertyValue(properties[i]).toString());
}
helper.parse(project, buildFile);
if (StringUtil.isEmptyOrNull(target))
project.executeTarget(project.getDefaultTarget());
else
project.executeTarget(target);
setProperties(project.getProperties());
}
catch (Exception bex)
{
exception = bex;
_error = true;
if (_log.isErrorEnabled())
_log.error("Error processing build script " + bex.toString());
}
finally
{
if (project != null)
{
project.fireBuildFinished(exception);
project.removeBuildListener(logger);
logger = null;
project = null;
}
helper = null;
}
> How are you starting your java app? Are you using any memory options?
> What does your app do? Sorta difficult to say for sure without more
>information.
Ritesh Trivedi wrote:
> Hi,
>
> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
> calling and executing Ant target from within my java program. I am
> seeing Out Of Memory errors on Solaris on Windows 2000 it works
> perfectly fine - no leaks.
>
> Any advise or pointers?
>
> Thanks
> Ritesh
>
> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>> Hi,
>>
>> I am experiencing memory leak while executing Ant targets multiple
>> times from java program. It seems to me that the classloader instances
>> are lying around and takes heap space for each run.
>>
>> Any fixes for the issue?
>>
>> Thanks
>> Ritesh
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
On 5/8/06, Ritesh Trivedi <ri...@gmail.com> wrote:
> Hi,
>
> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
> calling and executing Ant target from within my java program. I am
> seeing Out Of Memory errors on Solaris on Windows 2000 it works
> perfectly fine - no leaks.
>
> Any advise or pointers?
>
> Thanks
> Ritesh
>
> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
> > Hi,
> >
> > I am experiencing memory leak while executing Ant targets multiple
> > times from java program. It seems to me that the classloader instances
> > are lying around and takes heap space for each run.
> >
> > Any fixes for the issue?
> >
> > Thanks
> > Ritesh
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Memory Leak on Solaris?
Posted by "Scot P. Floess" <fl...@mindspring.com>.
How are you starting your java app? Are you using any memory options?
What does your app do? Sorta difficult to say for sure without more
information.
Ritesh Trivedi wrote:
> Hi,
>
> I am using j2sdk 1.4.2_10 and Ant 1.6.5. I am using Ant Java API and
> calling and executing Ant target from within my java program. I am
> seeing Out Of Memory errors on Solaris on Windows 2000 it works
> perfectly fine - no leaks.
>
> Any advise or pointers?
>
> Thanks
> Ritesh
>
> On 7/18/05, Ritesh Trivedi <ri...@gmail.com> wrote:
>> Hi,
>>
>> I am experiencing memory leak while executing Ant targets multiple
>> times from java program. It seems to me that the classloader instances
>> are lying around and takes heap space for each run.
>>
>> Any fixes for the issue?
>>
>> Thanks
>> Ritesh
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org