You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Pablo Johnson <pj...@m1.aasa.com.pe> on 2010/12/02 15:19:21 UTC
Problem with java heap space
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.
Re: Problem with java heap space
Posted by Jon Svede <js...@yahoo.com>.
You need to make the PermGen space about 1/4 of the total heap. Right now you
have set to use 1/2 which is too large. If you want to use 512m as your heap
size you need to lower your PermGen size to 128m. You may also need to play
with these settings. You may need to increase your heap size to 1024m or
larger. You'll need to play around with it to figure out what works best for
you, there usually isn't a one size fits all answer in these situations. There
are other parameters for tuning a JVM that you might need to change, but you may
need to post those questions to a forum/distribution list related to tuning.
You might want to either test using a Java main() or else move the code to an
actual server and skip the MyEclipse set up. I know it's easy to do it the way
you are, but on your desktop you may not have enough memory to do everything at
once (run all your other apps and MyEclipse and Tomcat).
Jon
----- Original Message ----
From: Pablo Johnson <pj...@aasa.com.pe>
To: POI Users List <us...@poi.apache.org>
Sent: Fri, December 3, 2010 1:13:01 PM
Subject: Re: Problem with java heap space
Sorry the delay too..
i tried to put this
-Xms512m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m
on the tomcat 5.5 configuration inside
MyEclipse.. and it works but it takes about 8
minutes only for read the .xlsm file.
Is there any option?
thanks for your help.
At 17:49 02/12/2010, you wrote:
>Sorry for the delay in getting back to this. Be
>sure to reply with your OS and
>JVM info.
>
>Yes, I'd do what Dave suggested below but I'd also tweak the PermGen space,
>again if you are using Sun's JVM. If you are using another JVM (JRockit for
>example) the settings are different.
>
>
>If you keep getting the OOME, keep increasing
>the -Xms and -Xmx values, try to
>keep the PermGen sizing to 1/4 of the total
>allocation. Eventually you should
>find a memory sizing that works for your spreadsheet.
>
>Jon
>
>
>----- Original Message ----
>From: David Fisher <df...@jmlafferty.com>
>To: POI Users List <us...@poi.apache.org>
>Sent: Thu, December 2, 2010 9:38:05 AM
>Subject: Re: Problem with java heap space
>
>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.Masters@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 <pj...@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 <pj...@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
> >> pjohnson@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-unsubscribe@poi.apache.org
>For additional commands, e-mail: user-help@poi.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>For additional commands, e-mail: user-help@poi.apache.org
>
>
>
>
>__________ Information from ESET Mail Security,
>version of virus signature database 5668 (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 5668 (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
pjohnson@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-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Problem with java heap space
Posted by Pablo Johnson <pj...@aasa.com.pe>.
Sorry the delay too..
i tried to put this
-Xms512m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m
on the tomcat 5.5 configuration inside
MyEclipse.. and it works but it takes about 8
minutes only for read the .xlsm file.
Is there any option?
thanks for your help.
At 17:49 02/12/2010, you wrote:
>Sorry for the delay in getting back to this. Be
>sure to reply with your OS and
>JVM info.
>
>Yes, I'd do what Dave suggested below but I'd also tweak the PermGen space,
>again if you are using Sun's JVM. If you are using another JVM (JRockit for
>example) the settings are different.
>
>
>If you keep getting the OOME, keep increasing
>the -Xms and -Xmx values, try to
>keep the PermGen sizing to 1/4 of the total
>allocation. Eventually you should
>find a memory sizing that works for your spreadsheet.
>
>Jon
>
>
>----- Original Message ----
>From: David Fisher <df...@jmlafferty.com>
>To: POI Users List <us...@poi.apache.org>
>Sent: Thu, December 2, 2010 9:38:05 AM
>Subject: Re: Problem with java heap space
>
>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.Masters@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 <pj...@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 <pj...@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
> >> pjohnson@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-unsubscribe@poi.apache.org
>For additional commands, e-mail: user-help@poi.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>For additional commands, e-mail: user-help@poi.apache.org
>
>
>
>
>__________ Information from ESET Mail Security,
>version of virus signature database 5668 (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 5668 (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
pjohnson@aasa.com.pe
PAntes de imprimir este mensaje, asegúrese que
sea necesario. El medio ambiente está en nuestras manos.
Re: Problem with java heap space
Posted by Jon Svede <js...@yahoo.com>.
Sorry for the delay in getting back to this. Be sure to reply with your OS and
JVM info.
Yes, I'd do what Dave suggested below but I'd also tweak the PermGen space,
again if you are using Sun's JVM. If you are using another JVM (JRockit for
example) the settings are different.
If you keep getting the OOME, keep increasing the -Xms and -Xmx values, try to
keep the PermGen sizing to 1/4 of the total allocation. Eventually you should
find a memory sizing that works for your spreadsheet.
Jon
----- Original Message ----
From: David Fisher <df...@jmlafferty.com>
To: POI Users List <us...@poi.apache.org>
Sent: Thu, December 2, 2010 9:38:05 AM
Subject: Re: Problem with java heap space
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.Masters@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 <pj...@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 <pj...@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
>> pjohnson@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-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Problem with java heap space
Posted by David Fisher <df...@jmlafferty.com>.
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.Masters@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 <pj...@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 <pj...@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
>> pjohnson@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-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Problem with java heap space
Posted by Lo...@log-net.com.
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 <pj...@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 <pj...@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
> pjohnson@aasa.com.pe
>
> PAntes de imprimir este mensaje, asegúrese que
> sea necesario. El medio ambiente está en nuestras manos.
Re: Problem with java heap space
Posted by Pablo Johnson <pj...@aasa.com.pe>.
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 <pj...@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
pjohnson@aasa.com.pe
PAntes de imprimir este mensaje, asegúrese que
sea necesario. El medio ambiente está en nuestras manos.
Re: Problem with java heap space
Posted by Mark Beardsley <ma...@tiscali.co.uk>.
Please will you start a new thread for this question. It does not relate to
the search/replace functionality and it is likely that many list members
will overlook it for that reason.
Yours
Mark B
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Embed-string-data-to-docx-file-in-java-tp3287560p3289481.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Problem with java heap space
Posted by Lo...@log-net.com.
What's your java heap set to?
Pablo Johnson <pj...@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.