[ ant-contrib-Bugs-1680294 ] ForEach throws OutOfMemoryError

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Bugs item #1680294, was opened at 2007-03-13 20:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1680294&group_id=36177

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: logic
Group: v1.0 (example)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ForEach throws OutOfMemoryError

Initial Comment:
I was assign to upgrade an old project pack configuration.In the project build script,the task "foreach" was called many times(in some loops),and it went down at a un-certain time with a java.lang.OutOfMemoryError.I tried to set a eviroment variable "ANT_OPTS=-Xms512m -Xmx1024m" to increase ant's memory usage forcibly and modify class "ForEach"'s source code where it creates and executes tasks as follow,but the error point just went forward a little.I also try to trace the error,the result shows at the construtor of ForEach.class JVM throws the OutOfMemoryError.I hope you can help me out of this trouble,Thank you.
BTW: My machine is Intel pentium 4 3.0GHz Mem:512M*4 JDK:1.4.2_11
Modified ForEach.execute() code as here:
for (int i = 0; i < sz; i++) {
                val = values.elementAt(i);
                ct = createCallTarget();
                p = ct.createParam();
                p.setName(param);

                if (val instanceof File)
                    p.setLocation((File) val);
                else
                    p.setValue((String) val);

                ct.execute();
                System.gc();

            //tasks.addElement(ct);
        }

        /* if (parallel && maxThreads > 1) {
            executeParallel(tasks);
        } else {
            executeSequential(tasks);
        }*/

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1680294&group_id=36177

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.