Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # dev >> Setting maxmemory for JUnit tests


Copy link to this message
-
Setting maxmemory for JUnit tests
I was running into an out-of-memory error while running the  
org.apache.avro.mapred.TestWordCountSpecific and TestWordCountGeneric  
tests:

     [junit] java.lang.OutOfMemoryError: Java heap space
     [junit] at org.apache.hadoop.mapred.MapTask
$MapOutputBuffer.<init>(MapTask.java:781)
     [junit] at  
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:350)
     [junit] at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
     [junit] at org.apache.hadoop.mapred.LocalJobRunner
$Job.run(LocalJobRunner.java:177)

I added a maxmemory attribute to the junit task in the Java build.xml,  
and it seemed to fix the problem:

   <macrodef name="test-runner">
     <attribute name="files.location" />
     <attribute name="tests.pattern" />
     <attribute name="test.dir" default="${test.java.build.dir}" />
     <sequential>
       <junit showoutput="yes"
              printsummary="withOutAndErr"
              haltonfailure="no"
              fork="yes"
    maxmemory="256m"

I can file a Jira issue and a patch, but seems pretty trivial...

-- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g
+
Doug Cutting 2010-06-24, 17:35
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB