Re: [JAVA2D] OutOfMemoryError
Having just beat my head against a virtual brick wall for the last few days, I think I can help. Take a look at: http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html In particular, note these arguments about 3/4 of the way down the page. -Xmsn Specify the initial size, in bytes, of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 2MB. Examples: -Xms6291456 -Xms6144k -Xms6m -Xmxn Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. Examples: -Xmx83886080 -Xmx81920k -Xmx80m -Xms256M will set the initial swap space to 256 meg. -Xmx512M will set the maximum memory size to 512 meg. Use numbers appropriate for your computer. How you set the JVM arguments will depend on how you have your enviroment configured. I can't help you there. Also, try starting a separate thread to do your data analysis. You are running your data analysis in the AWT event thread. Best to just start a separate thread in your actionedPerformed handler and let go of the AWT event thread. Ken [EMAIL PROTECTED] wrote: Hi, I'm reading the integer data that is present in a .txt file and upon reading it I'm doing some compution. My program is working well and gud for small amount of data in the file, but when i'm trying to read large of amount of data that is present in the file I'm getting the below mentioned error. Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap spa ce at DataAnalysis.kohonen(DataAnalysis.java:472) at DataAnalysis.readfile(DataAnalysis.java:376) at DataAnalysis$submit.actionPerformed(DataAnalysis.java:215) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour ce) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) The thing that I couldn't able to get is when I'm checking at the lines 472; 376; 215 in my code, those lines are blank lines which dont have any code. I couldn't able to know like what went wrong and where i went wrong. [Message sent by forum member 'sarath44' (sarath44)] http://forums.java.net/jive/thread.jspa?messageID=227518 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: [JAVA2D] Printing data in dotmatrix printer with formating
Sorry it is "bill.txt". [Message sent by forum member 'aroop_bh' (aroop_bh)] http://forums.java.net/jive/thread.jspa?messageID=227543 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: [JAVA2D] Printing data in dotmatrix printer with formating
This is all between you, jasper reports, and your printer. AUTOSENSE basically just pumps the data in the file to the printer port (via GDI APIs). Not really different than : copy bill.html LPT1: So you can only send via AUTOSENSE something your printer understands. For dot matrix printers basic ASCII text with newlines, tabs etc is probably OK But its a bit suspicious that your file name ends with .html I doubt there's a dot matrix printer in the world that can render HTML directly -phil. [EMAIL PROTECTED] wrote: I have a dot matrix printer nad i want to print data directly to the dot matrix printer. I have use the JasperReport as reporting tool but it prints very slowly. I have also use the JRTextExporter exporter = new JRTextExporter(); for exporting reports in text but it can't make a good alignment to the text and event i can't do any type of formatting in the text File. My Code is [b]public void convertToText[/b]() { JRTextExporter exporter = new JRTextExporter(); File file = new File("C:\\bill.html"); try { exporter.setParameter(JRTextExporterParameter.JASPER_PRINT,report.getReport()); exporter.setParameter(JRTextExporterParameter.OUTPUT_FILE, file); exporter.setParameter(JRTextExporterParameter.PAGE_HEIGHT,new Integer(15)); exporter.setParameter(JRTextExporterParameter.PAGE_WIDTH,new Integer(22)); exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH,new Integer(30)); exporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT,new Integer(30)); exporter.exportReport(); getPrinter(file); } catch (Exception ex) { ex.printStackTrace(); } } [b]public void getPrinter[/b](File file) throws PrintException, FileNotFoundException { javax.print.DocFlavor flavor = javax.print.DocFlavor.INPUT_STREAM.AUTOSENSE; javax.print.attribute.PrintRequestAttributeSet pras = new javax.print.attribute.HashPrintRequestAttributeSet(); PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); javax.print.DocPrintJob job = printService.createPrintJob(); java.io.FileInputStream fis = new java.io.FileInputStream(file); javax.print.attribute.DocAttributeSet das = new javax.print.attribute.HashDocAttributeSet(); javax.print.Doc doc = new javax.print.SimpleDoc(fis, flavor, das); job.print(doc, pras); } } [Message sent by forum member 'aroop_bh' (aroop_bh)] http://forums.java.net/jive/thread.jspa?messageID=227537 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
[JAVA2D] Printing data in dotmatrix printer with formating
I have a dot matrix printer nad i want to print data directly to the dot matrix printer. I have use the JasperReport as reporting tool but it prints very slowly. I have also use the JRTextExporter exporter = new JRTextExporter(); for exporting reports in text but it can't make a good alignment to the text and event i can't do any type of formatting in the text File. My Code is [b]public void convertToText[/b]() { JRTextExporter exporter = new JRTextExporter(); File file = new File("C:\\bill.html"); try { exporter.setParameter(JRTextExporterParameter.JASPER_PRINT,report.getReport()); exporter.setParameter(JRTextExporterParameter.OUTPUT_FILE, file); exporter.setParameter(JRTextExporterParameter.PAGE_HEIGHT,new Integer(15)); exporter.setParameter(JRTextExporterParameter.PAGE_WIDTH,new Integer(22)); exporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH,new Integer(30)); exporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT,new Integer(30)); exporter.exportReport(); getPrinter(file); } catch (Exception ex) { ex.printStackTrace(); } } [b]public void getPrinter[/b](File file) throws PrintException, FileNotFoundException { javax.print.DocFlavor flavor = javax.print.DocFlavor.INPUT_STREAM.AUTOSENSE; javax.print.attribute.PrintRequestAttributeSet pras = new javax.print.attribute.HashPrintRequestAttributeSet(); PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); javax.print.DocPrintJob job = printService.createPrintJob(); java.io.FileInputStream fis = new java.io.FileInputStream(file); javax.print.attribute.DocAttributeSet das = new javax.print.attribute.HashDocAttributeSet(); javax.print.Doc doc = new javax.print.SimpleDoc(fis, flavor, das); job.print(doc, pras); } } [Message sent by forum member 'aroop_bh' (aroop_bh)] http://forums.java.net/jive/thread.jspa?messageID=227537 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: [JAVA2D] OutOfMemoryError
Hi. Did you tried to increase the Memory of the Virtual Machine using the command -XmxNNNm? Where NNN is the max amount of memory you want to set. As an instance, -Xmx256m ... -Xmx512m [Message sent by forum member 'dany111' (dany111)] http://forums.java.net/jive/thread.jspa?messageID=227532 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".