Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

heap size problem!!

Posted on 2007-04-09
11
758 Views
Last Modified: 2008-01-09
Hi experts ..

how to set the heap size for Apache Ant 1.7.0 ??
0
Comment
Question by:DrAske
  • 6
  • 5
11 Comments
 
LVL 92

Expert Comment

by:objects
ID: 18879183
specfy it using the ANT_OPTS env var

http://ant.apache.org/manual/running.html
0
 
LVL 9

Author Comment

by:DrAske
ID: 18879198
you mean I have to add ANT_OPTS to enviroment variable??
could you pleas give me the full syntax I should put ??
0
 
LVL 9

Author Comment

by:DrAske
ID: 18879213
I mean what should I put exactly in the enviroment varaible ?
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 92

Expert Comment

by:objects
ID: 18879359
eg. to set it to 512Mb

ANT_OPS=-Xmx512m
0
 
LVL 92

Expert Comment

by:objects
ID: 18879362
ANT_OPTS=-Xmx512m
0
 
LVL 9

Author Comment

by:DrAske
ID: 18879409
Thank you, I'll try it tomorrow morning and I'll send back the result :o)
0
 
LVL 9

Author Comment

by:DrAske
ID: 18880595
that's doesn't work!!
I've tried to set ANT_OPTS from the command prompt:
set ANT_OPTS = -Xms512m
set ANT_OPTS= -Xmx512m
It has been set successfully, but still get outOfMemory Error !!

What I'm trying to do is writing a JUnit testCase for a method in a class, this method returns the sum of size of 3 ArrayLists in this class, in that method I want to check if the counter == Integer.MAX_VALUE then return Integer.MAX_VALUE!!

To be able to test this method I have to set the three Lists to number of elements it exceeds Integer.MAX_VALUE, so when calling size() method it will return Integer.MAX_VALUE!!

This is the testCase, but It gives me outOfMemory during adding elements to the lists:
public void testCollectionView1Accuracy1() throws Exception {
            for (int i = 0; i < Integer.MAX_VALUE / 2+100; ++i){
                  collection.add(new Character('A'));
            }
            for(int i = 0; i<Integer.MAX_VALUE/2+100; ++i) {
           elementsToAdd.add(new Character('A'));
        }
        collectionView = new CollectionView(collection, elementsToAdd, null);
            assertTrue("size() incorrect.", collectionView.size() == Integer.MAX_VALUE);
    }

what should I do??
0
 
LVL 92

Expert Comment

by:objects
ID: 18880604
that requests a lot motre than 512Mb doesn't it?
why does the test need to add so many elements to the collection?
0
 
LVL 9

Author Comment

by:DrAske
ID: 18880616
The class is wrapper for some collections in java, I'm using it as a view so it allows to filter the collection, makes changes on it without affecting the original collection.

>>why does the test need to add so many elements to the collection?
to check if size() method returns Integer.MAX_VALUE if the sum of the three lists exceeds it!!
in the real-world this wrapper class will hold a large number of records from database, for large systems.
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 18880666

My calcs show that test needing 4Gb+ !!
Not a terribly friendly test :)
0
 
LVL 9

Author Comment

by:DrAske
ID: 18880669
mmm!! I see, so my laptop won't handle it :o)

thank you very much,
I really appreciate your help :o)

regards,
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javap not working 8 57
null output 3 35
ejb wildfly example 2 16
jsp insert to database example 2 43
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question