Issue Details (XML | Word | Printable)

Key: CACTUS-158
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Felipe Leme
Reporter: Matheus Piai Bianconi
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Cactus

OutOfMemory in application server

Created: 06/Dec/04 12:42 PM   Updated: 10/Dec/04 02:26 PM
Return to search
Component/s: Ant Integration
Affects Version/s: 1.6.1
Fix Version/s: 1.7

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works CACTUS_158.patch 2004-12-10 12:29 PM Matheus Piai Bianconi 2 kB

Resolution Date: 10/Dec/04 02:14 PM


 Description  « Hide
Cactus does not allow to define memory used by application server, then some tests fail and error "OutOfMemoryError" occur.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Matheus Piai Bianconi added a comment - 06/Dec/04 06:39 PM
PS: We are working on a solution and will send a patch later (even though this solution may not be generic).


Felipe Leme added a comment - 08/Dec/04 11:05 AM
Vincent,

I haven't seen the patch yet, but I have the feeling there are 2 places where we should consider a generic approach:

1.This issue might happens in any container, not only JBoss, so the fix should go into the super-class of all container tasks (I think it should be defined on AbstractContainerJava or somthing like that). Note also that this issue might be appliable to Cargo as well.

2.The Java Ant tasks has a method to set the max memory; using that method should fix that specific problem, but we could be generic here too, allowing arbitrary JVM args to be passed to the container.

Once we define a way to fix it, I could implement the changes. So, any thoughts?

-- Felipe

Vincent Massol added a comment - 09/Dec/04 10:10 AM
Fyi, just done that for Cargo. See http://jira.codehaus.org/browse/CARGO-89

Matheus Piai Bianconi added a comment - 10/Dec/04 12:29 PM
This is the patch - it hasn't been fully tested yet, but it should work.

Vincent Massol added a comment - 10/Dec/04 12:51 PM
Hi Matheus,

Just a quick question: why don't you call java.setJvmargs() instead of calling java.createJvmarg().setValue(...)? Does your solution work when you have to pass several JVM arguments?

I'm curious because I've used setJvmargs() for Cargo and it is working fine.

Thanks

Felipe Leme added a comment - 10/Dec/04 01:14 PM
Vincent,

What about the maven plugin? Should we create a generic property for all containers (like cactus.containers.jvmArgs) or one per container (cactus.jboss3x.jvmArgs, cactus.tomcat5.jvmArgs, etc...)?
 

Felipe Leme added a comment - 10/Dec/04 01:24 PM
Vincent,

I tried the setJvmArgs, but got the following message:

   [cactus] The jvmargs attribute is deprecated. Please use nested jvmarg elemets.

Did you get that with Cargo too?

I haven't found a @deprecated in the Ant's API, so I think this message is a bug - I think it was meant only to the Ant task, not the java call (i.e., it should be displayed only when jvmargs is passed as an attribute to the java task).

-- Felipe

Vincent Massol added a comment - 10/Dec/04 01:28 PM
Felipe,

1/ About the deprecation. This should only happen if you use <java jvmarsg="...">. You shouldn't get it at the Java API level (at least I did not notice it when I've done the change on Cargo - Maybe I've just missed it).

2/ About the maven plugin. I think having one per container is the most flexible and would be useful to run cactus tests on several containers at once. You could always have a generic one and then have each container-specific one default to the generic one.

thanks

Felipe Leme added a comment - 10/Dec/04 01:41 PM
Nevermind, I figured out the solution: calling createJvmarg().setLines() instead of createJvmarg().setValue().

In fact, that's exactly what the setJvmargs method does:

    public void setJvmargs(String s) {
        log("The jvmargs attribute is deprecated. "
            + "Please use nested jvmarg elements.", Project.MSG_WARN);
        cmdl.createVmArgument().setLine(s);
    }

    public Commandline.Argument createJvmarg() {
        return cmdl.createVmArgument();
    }

So, I fixed that - the only pending issue now is which properties to use on the maven plugin.

-- Felipe

Vincent Massol added a comment - 10/Dec/04 01:57 PM
ok, I get it. I've fixed Cargo accordingly. Thanks.

Felipe Leme added a comment - 10/Dec/04 02:14 PM
I also applied the changes to the maven plugin - please let me know if they're fine...

Vincent Massol added a comment - 10/Dec/04 02:26 PM
I haven't tried them but sounds good to me!