Hi - If you are in unix then the typical way to set these environment variables for Tomcat is in the setenv.sh script found in the /bin directory and called by the catalina.sh script.
We use Apache Tomcat 6.0.29 and Java SE 1.6.0_18. Here are some of the settings from out setenv.sh: # You want lots of memory. JAVA_OPTS="$JAVA_OPTS -Xms1024M -Xmx1024M" # If you are using Java 6 and multi-cores you want GC that does not block. JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+PrintGCTimeStamps" # You need to be "headless" for POI operations like setting column widths JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true" # You probably want to be in server mode JAVA_OPTS="$JAVA_OPTS -server" Depending on your environment you might need your admin to make these settings for you. Sorry that POI can take so much memory, but it is what it is. Regards, Dave On Dec 2, 2010, at 8:07 AM, louis.mast...@log-net.com wrote: > Windows or *nix? What version of tomcat? For Windows, tomcat >5.5, there > is a configure option in your menu. For all others, I think you need to > add the parms to a CATALINA_OPTS env variable. > > -Lou > > > Pablo Johnson <pjohn...@aasa.com.pe> wrote on 12/02/2010 10:21:58 AM: > >> Hi >> >> im using apache-tomcat >> im trying to do what jon Svede told me >> >> On the Sun JVM these are the -X and -XX args, something like this: >> -Xms1024m -Xmx1024 -XX:PermSize=256m -XX:MaxPermSize=256m >> You would need to do this in the start script of your >> Tomcat/WebLogic/WebSphere/etc container. >> Hope that helps, >> Jon >> >> but i dont know where and how to modify it.. >> i dont know how much memory is assigned to my >> java heap set to.. i think its 256. >> >> thanks >> >> >> >> At 10:12 02/12/2010, you wrote: >>> What's your java heap set to? >>> >>> Pablo Johnson <pjohn...@m1.aasa.com.pe> wrote on 12/02/2010 09:19:21 > AM: >>> >>>> hello! >>>> >>>> i`m doing a web application and i`m having this problem: >>>> >>>> >>>> java.lang.OutOfMemoryError: Java heap space >>>> org.apache.xmlbeans.impl.store.Cur.createElementXobj(Cur.java:257) >>>> org.apache.xmlbeans.impl.store.Cur$CurLoadContext. >>>> startElement(Cur.java:2992) >>>> org.apache.xmlbeans.impl.store.Locale$SaxHandler. >>>> startElement(Locale.java:3198) >>>> org.apache.xmlbeans.impl.piccolo.xml.Piccolo. >>>> reportStartTag(Piccolo.java:1082) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> parseAttributesNS(PiccoloLexer.java:1822) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> parseOpenTagNS(PiccoloLexer.java:1521) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> parseTagNS(PiccoloLexer.java:1362) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> parseXMLNS(PiccoloLexer.java:1293) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> parseXML(PiccoloLexer.java:1261) >>>> org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer. >>>> yylex(PiccoloLexer.java:4808) >>>> > org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yylex(Piccolo.java:1290) >>>> org.apache.xmlbeans.impl.piccolo.xml.Piccolo. >>>> yyparse(Piccolo.java:1400) >>>> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:714) >>>> org.apache.xmlbeans.impl.store.Locale$SaxLoader. >>>> load(Locale.java:3439) >>>> org.apache.xmlbeans.impl.store.Locale. >>>> parseToXmlObject(Locale.java:1270) >>>> org.apache.xmlbeans.impl.store.Locale. >>>> parseToXmlObject(Locale.java:1257) >>>> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase. >>>> parse(SchemaTypeLoaderBase.java:345) >>>> org.openxmlformats.schemas.spreadsheetml.x2006.main. >>>> WorksheetDocument$Factory.parse(Unknown >>>> Source) >>>> org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:170) >>>> org.apache.poi.xssf.usermodel.XSSFSheet. >>>> onDocumentRead(XSSFSheet.java:162) >>>> org.apache.poi.xssf.usermodel.XSSFWorkbook. >>>> onDocumentRead(XSSFWorkbook.java:227) >>>> org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190) >>>> org.apache.poi.xssf.usermodel.XSSFWorkbook. >>>> <init>(XSSFWorkbook.java:175) >>>> org.apache.poi.ss.usermodel.WorkbookFactory. >>>> create(WorkbookFactory.java:63) >>>> > com.aasa.logic.DespieceLogic.trabajaPlantilla(DespieceLogic.java:449) >>>> com.aasa.logic.DespieceLogic. >>>> trabajarAsignacion(DespieceLogic.java:76) >>>> com.aasa.action.LisBandejaDespieceAction. >>>> descargaArchivo(LisBandejaDespieceAction.java:360) >>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> sun.reflect.NativeMethodAccessorImpl. >>>> invoke(NativeMethodAccessorImpl.java:39) >>>> sun.reflect.DelegatingMethodAccessorImpl. >>>> invoke(DelegatingMethodAccessorImpl.java:25) >>>> java.lang.reflect.Method.invoke(Method.java:592) >>>> org.apache.struts.actions.DispatchAction. >>>> dispatchMethod(DispatchAction.java:274) >>>> >>>> >>>> >>>> I`m trying to open a .xlsm file with 2.06 mb. This is my code: >>>> >>>> fileIn = new SmbFileInputStream(plantilla); >>>> wb = WorkbookFactory.create(fileIn); // <------------this >>>> line is the problem >>>> >>>> final Sheet sheetDespacho = wb.getSheet("DESPACHOS"); >>>> for (int i=0; i<lstDespacho.size();i++){ >>>> Row row = sheetDespacho.getRow(i); >>>> if (row == null){ >>>> row = sheetDespacho.createRow(i); >>>> } >>>> Cell cell = row.getCell(0); >>>> if (cell == null){ >>>> cell = row.createCell(0); >>>> } >>>> cell.setCellValue(new Integer(lstDespacho.get(i))); >>>> >>>> cell = row.getCell(1); >>>> if (cell == null){ >>>> cell = row.createCell(1); >>>> } >>>> cell.setCellValue(i+1); >>>> } >>>> >>>> >>>> is there any other way to open this file? because it always throw me >>>> that exception: >>>> javax.servlet.ServletException: Java heap space >>>> >>>> thanks. >>> >>> >>> __________ Information from ESET Mail Security, >>> version of virus signature database 5667 (20101202) __________ >>> >>> The message was checked by ESET Mail Security. >>> http://www.eset.com >>> >>> >>> >>> >>> __________ Información de ESET NOD32 Antivirus, >>> versión de la base de firmas de virus 5667 (20101202) __________ >>> >>> ESET NOD32 Antivirus ha comprobado este mensaje. >>> >>> http://www.eset.com >> >> Pablo Johnson Rojas >> Corporación Aceros Arequipa S.A. >> Departamento de Informática >> pjohn...@aasa.com.pe >> >> PAntes de imprimir este mensaje, asegúrese que >> sea necesario. El medio ambiente está en nuestras manos. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org