Out of memory error to view AVI files
Hi everyone,
I've imported 6 AVI files from the same source into the browser. All work fine except for 2 of them. When I click on those files in the browser to preview them in the viewer, I receive 2 messages: the first one is 'general error', the second 'out of memory'. What strikes me is that in the browser, the duration marks 0 although the files are respectively 4MB and 1,6MB. I've compared them to the 4 others and they are similar. Any idea would be welcome. Many thanks in advance.
Welcome to the forum!
AVI files don't work with FCP. FCP is based in Quicktime. You will need to convert all you AVI files to an quicktime editing codec like ProRes or DV-NTSC You can find a list of editing codecs in FCP's Easy Setup. You can use Compressor to convert the files.
Similar Messages
-
Hello All,
I am getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1.
Also, it is creating issue to convert PDF into TIFF. Please provide the solution ASAP.I am using Adobe reader XI. When i open PDF it gives "OUT of memory" error after scrolling PDF gives another alert "Insufficient data for an image". after clicking both alerts it loads full data of PDF. It is not happening with all PDFs. couple of PDFs are facing this issue. Because of this error my software is not able to print these PDFS into TIFF. My OS in window7*64. I tried it on win2012R2 and XP. Same issue is generating there.
It has become critical issue for my production. -
Out of Memory Error and large video files
I created a simple page that links a few large video files (2.5 gig) total size. On Preview or FTP upload Mues crashes and gives a Out of Memory error. How should we handle very large files like this?
Upload the files to your host using an FTP client (i.e. Filezilla) and hyperlink to them from within your Muse site.
Muse is currently not designed to upload files this large. The upload functionality takes the simple approach of reading an entire linked file into RAM and then uploading it. Given Muse is currently a 32-bit application, it's limited to using 2Gb of RAM (or less) at any given time regardless of how much RAM you have physically installed. We should add a check to the "Link to File..." feature so it rejects files larger than a few hundred megs and puts up a explanation alert. (We're also hard at work on the move to being a 64-bit app, but that's not a small change.)
In general your site visitor will have a much better experience viewing such videos if you upload them to a service like YouTube or Vimeo rather than hosting them yourself. Video hosting services provide a huge amount of optimization of the delivery of video that's not present for a file hosted on standard hosting (i.e. automatic resizing of the video to the appropriate resolution for the visitor's device (rather than potentially downloading a huge amount of unneeded data), transcoding to the video format required by the visitor's browser (rather than either having to due so yourself or have some visitors unable to view your video), automatic distribution of a highly viewed video to multiple data centers for better performance in multiple geographies, and no doubt tons of other stuff I'm not thinking of or am ignorant of. -
Out of memory error when writing large file
I have the piece of code below which works fine for writing small files, but when it encounters much larger files (>80M), the jvm throws an out of memory error.
I believe it has something to do with the Stream classes. If I were to replace my PrintStream reference with the System.out object (which is commented out below), then it runs fine.
Anyone else encountered this before?
print = new PrintStream(new FileOutputStream(new File(a_persistDir, getCacheFilename()),
false));
// print = System.out;
for(Iterator strings = m_lookupTable.keySet().iterator(); strings.hasNext(); ) {
StringBuffer sb = new StringBuffer();
String string = (String) strings.next();
String id = string;
sb.append(string).append(KEY_VALUE_SEPARATOR);
Collection ids = (Collection) m_lookupTable.get(id);
for(Iterator idsIter = ids.iterator(); idsIter.hasNext();) {
IBlockingResult blockingResult = (IBlockingResult) idsIter.next();
sb.append(blockingResult.getId()).append(VALUE_SEPARATOR);
print.println(sb.toString());
print.flush();
} catch (IOException e) {
} finally {
if( print != null )
print.close();
}Yes, my first code would just print the strings as I got them. But it was running out of memory then as well. I thought of constructing a StringBuffer first because I was afraid that the PrintStream wasn't allocating the memory correctly.
I've also tried flushing the PrintStream after every line is written but I still run into trouble. -
Out of Memory Error bcoz of xml file size
Hi,
Help me to solve this out of memory error, if xml file size
is increased means
it is not displaying anything and displaying this out of
memory error.
Thanking you
Regards
Nirmalatha.NYou should avoid loading large sized XML files in your Flash
Lite application. There is a limit on incoming data, and anything
beyond that will give an error. My experience has been around 1000
characters in a single stream of incoming text.
A possible solution your memory problem is to use a middle
language like PHP, ASP etc, to stream a single XML data file in
parts to your Flash Lite application. This means you avoid loading
XML directly in Flash.
Mariam -
Out of Memory error when opening pdf file. Windows XP Reader v 10.0.1
I am getting this message when trying to open some of
my saved pdf files. It happens on some but not others.yeah its working fine. Thank you very much..
But it would be better if we provide the chunklength rather than using a zero to upload the file fastly. -
XSOMParser throwing out of memory error
Hello,
Currently we are using XSOM parser with DomAnnotationParserFactory to parse XSD file. For small files it is working fine. However is was throwing out of memory error while parsing 9MB file. We could understood reason behind this. Is there any way to resolve this issue?
Code :
XSOMParser parser = new XSOMParser();
parser.setAnnotationParser(new DomAnnotationParserFactory());
XSSchemaSet schemaSet = null;
XSSchema xsSchema = null;
parser.parse(configFilePath);
Here we are getting error on parser.parse() method. (using 128 MB heap memory using -Xrs -Xmx128m).
Stack Trace :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at oracle.xml.parser.v2.XMLDocument.xdkIncCurrentId(XMLDocument.java:3020)
at oracle.xml.parser.v2.XMLNode.xdkInit(XMLNode.java:2758)
at oracle.xml.parser.v2.XMLNode.<init>(XMLNode.java:423)
at oracle.xml.parser.v2.XMLNSNode.<init>(XMLNSNode.java:144)
at oracle.xml.parser.v2.XMLElement.<init>(XMLElement.java:373)
at oracle.xml.parser.v2.XMLDocument.createNodeFromType(XMLDocument.java:2865)
at oracle.xml.parser.v2.XMLDocument.createElement(XMLDocument.java:1896)
at oracle.xml.parser.v2.DocumentBuilder.startElement(DocumentBuilder.java:224)
at oracle.xml.parser.v2.XMLElement.reportStartElement(XMLElement.java:3188)
at oracle.xml.parser.v2.XMLElement.reportSAXEvents(XMLElement.java:2164)
at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:337)
at oracle.xml.jaxp.JXTransformerHandler.endDocument(JXTransformerHandler.java:141)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:267)
at org.xml.sax.helpers.XMLFilterImpl.endElement(Unknown Source)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1257)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at com.sun.xml.xsom.parser.JAXPParser.parse(JAXPParser.java:79)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:129)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:122)
Please let me know if anyone has comment on this.
Also let me know if there any other parser which handles large input files efficiently.Hello,
Currently we are using XSOM parser with DomAnnotationParserFactory to parse XSD file. For small files it is working fine. However is was throwing out of memory error while parsing 9MB file. We could understood reason behind this. Is there any way to resolve this issue?
Code :
XSOMParser parser = new XSOMParser();
parser.setAnnotationParser(new DomAnnotationParserFactory());
XSSchemaSet schemaSet = null;
XSSchema xsSchema = null;
parser.parse(configFilePath);
Here we are getting error on parser.parse() method. (using 128 MB heap memory using -Xrs -Xmx128m).
Stack Trace :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at oracle.xml.parser.v2.XMLDocument.xdkIncCurrentId(XMLDocument.java:3020)
at oracle.xml.parser.v2.XMLNode.xdkInit(XMLNode.java:2758)
at oracle.xml.parser.v2.XMLNode.<init>(XMLNode.java:423)
at oracle.xml.parser.v2.XMLNSNode.<init>(XMLNSNode.java:144)
at oracle.xml.parser.v2.XMLElement.<init>(XMLElement.java:373)
at oracle.xml.parser.v2.XMLDocument.createNodeFromType(XMLDocument.java:2865)
at oracle.xml.parser.v2.XMLDocument.createElement(XMLDocument.java:1896)
at oracle.xml.parser.v2.DocumentBuilder.startElement(DocumentBuilder.java:224)
at oracle.xml.parser.v2.XMLElement.reportStartElement(XMLElement.java:3188)
at oracle.xml.parser.v2.XMLElement.reportSAXEvents(XMLElement.java:2164)
at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:337)
at oracle.xml.jaxp.JXTransformerHandler.endDocument(JXTransformerHandler.java:141)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:267)
at org.xml.sax.helpers.XMLFilterImpl.endElement(Unknown Source)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1257)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at com.sun.xml.xsom.parser.JAXPParser.parse(JAXPParser.java:79)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:129)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:122)
Please let me know if anyone has comment on this.
Also let me know if there any other parser which handles large input files efficiently. -
RoboHelp 9 gives an out of memory error and crashes when I try to import or link a Frame 10 file or
I have Tech Suite 3. If I start a new RoboHelp project and try to import or link Frame files, RoboHelp tries for a while, then I get an Out of Memory error and the program crashes.
I opened one of the sample projects and was able to link to one of my frame files without any problem, so it seems to be an issue with creating something new.
Any suggestions?It happens when I create a new project and then try to import or link frame docs to make up the content. It starts scanning, then crashes. I did get it to the conversion setting page once, but no further.
It does not happen if I open one of the supplied example projects and link a file. But then it doesn't let me choose, during import, any style mapping. And I can't delete the sample project fold
Twice now it has told me when I tried to import (not link, but import) that my .fm file could not be opened, and told me to verify that Frame is installed (it is) and that the file is a valid frame file (it is).
The docs and project are in separate folders on my C: drive. -
Out of Memory Error While deploying as EAR file
Hai,
I was trying to deploy an EAR file of size 63 MB which inturn containing about 60 EJB.jars. No WARs. application.xml has all the entries for the JARs. While I am deploying it is giving Out of Memory Error. Is there any way to tweak this problem. I am using my own hand written java application which uses the SunONE deployment APIs for deployment. Can u please tell how to tackle this problem. I am running my application through a batch file which uses jdk1.4.
Please help me regarding this issue.You can set the initial heap size and maximum heap size for the JVM, either in the app-server admin console, or maybe in one of your scripts. You look-up the syntax!...
I had this error yesterday. I too had run out of memory (150Mb). You simply need to allocate more to the app-server. -
Uploading large files from applet to servlet throws out of memory error
I have a java applet that needs to upload files from a client machine
to a web server using a servlet. the problem i am having is that in
the current scheme, files larger than 17-20MB throw an out of memory
error. is there any way we can get around this problem? i will post
the client and server side code for reference.
Client Side Code:
import java.io.*;
import java.net.*;
// this class is a client that enables transfer of files from client
// to server. This client connects to a servlet running on the server
// and transmits the file.
public class fileTransferClient
private static final String FILENAME_HEADER = "fileName";
private static final String FILELASTMOD_HEADER = "fileLastMod";
// this method transfers the prescribed file to the server.
// if the destination directory is "", it transfers the file to
"d:\\".
//11-21-02 Changes : This method now has a new parameter that
references the item
//that is being transferred in the import list.
public static String transferFile(String srcFileName, String
destFileName,
String destDir, int itemID)
if (destDir.equals(""))
destDir = "E:\\FTP\\incoming\\";
// get the fully qualified filename and the mere filename.
String fqfn = srcFileName;
String fname =
fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
try
//importTable importer = jbInit.getImportTable();
// create the file to be uploaded and a connection to
servlet.
File fileToUpload = new File(fqfn);
long fileSize = fileToUpload.length();
// get last mod of this file.
// The last mod is sent to the servlet as a header.
long lastMod = fileToUpload.lastModified();
String strLastMod = String.valueOf(lastMod);
URL serverURL = new URL(webadminApplet.strServletURL);
URLConnection serverCon = serverURL.openConnection();
// a bunch of connection setup related things.
serverCon.setDoInput(true);
serverCon.setDoOutput(true);
// Don't use a cached version of URL connection.
serverCon.setUseCaches (false);
serverCon.setDefaultUseCaches (false);
// set headers and their values.
serverCon.setRequestProperty("Content-Type",
"application/octet-stream");
serverCon.setRequestProperty("Content-Length",
Long.toString(fileToUpload.length()));
serverCon.setRequestProperty(FILENAME_HEADER, destDir +
destFileName);
serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
if (webadminApplet.DEBUG) System.out.println("Connection with
FTP server established");
// create file stream and write stream to write file data.
FileInputStream fis = new FileInputStream(fileToUpload);
OutputStream os = serverCon.getOutputStream();
try
// transfer the file in 4K chunks.
byte[] buffer = new byte[4096];
long byteCnt = 0;
//long percent = 0;
int newPercent = 0;
int oldPercent = 0;
while (true)
int bytes = fis.read(buffer);
byteCnt += bytes;
//11-21-02 :
//If itemID is greater than -1 this is an import file
transfer
//otherwise this is a header graphic file transfer.
if (itemID > -1)
newPercent = (int) ((double) byteCnt/ (double)
fileSize * 100.0);
int diff = newPercent - oldPercent;
if (newPercent == 0 || diff >= 20)
oldPercent = newPercent;
jbInit.getImportTable().displayFileTransferStatus
(itemID,
newPercent);
if (bytes < 0) break;
os.write(buffer, 0, bytes);
os.flush();
if (webadminApplet.DEBUG) System.out.println("No of bytes
sent: " + byteCnt);
finally
// close related streams.
os.close();
fis.close();
if (webadminApplet.DEBUG) System.out.println("File
Transmission complete");
// find out what the servlet has got to say in response.
BufferedReader reader = new BufferedReader(
new
InputStreamReader(serverCon.getInputStream()));
try
String line;
while ((line = reader.readLine()) != null)
if (webadminApplet.DEBUG) System.out.println(line);
finally
// close the reader stream from servlet.
reader.close();
} // end of the big try block.
catch (Exception e)
System.out.println("Exception during file transfer:\n" + e);
e.printStackTrace();
return("FTP failed. See Java Console for Errors.");
} // end of catch block.
return("File: " + fname + " successfully transferred.");
} // end of method transferFile().
} // end of class fileTransferClient
Server side code:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;
// This servlet class acts as an FTP server to enable transfer of
files
// from client side.
public class FtpServerServlet extends HttpServlet
String ftpDir = "D:\\pub\\FTP\\";
private static final String FILENAME_HEADER = "fileName";
private static final String FILELASTMOD_HEADER = "fileLastMod";
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException,
IOException
doPost(req, resp);
public void doPost(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException,
IOException
// ### for now enable overwrite by default.
boolean overwrite = true;
// get the fileName for this transmission.
String fileName = req.getHeader(FILENAME_HEADER);
// also get the last mod of this file.
String strLastMod = req.getHeader(FILELASTMOD_HEADER);
String message = "Filename: " + fileName + " saved
successfully.";
int status = HttpServletResponse.SC_OK;
System.out.println("fileName from client: " + fileName);
// if filename is not specified, complain.
if (fileName == null)
message = "Filename not specified";
status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
else
// open the file stream for the file about to be transferred.
File uploadedFile = new File(fileName);
// check if file already exists - and overwrite if necessary.
if (uploadedFile.exists())
if (overwrite)
// delete the file.
uploadedFile.delete();
// ensure the directory is writable - and a new file may be
created.
if (!uploadedFile.createNewFile())
message = "Unable to create file on server. FTP failed.";
status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
else
// get the necessary streams for file creation.
FileOutputStream fos = new FileOutputStream(uploadedFile);
InputStream is = req.getInputStream();
try
// create a buffer. 4K!
byte[] buffer = new byte[4096];
// read from input stream and write to file stream.
int byteCnt = 0;
while (true)
int bytes = is.read(buffer);
if (bytes < 0) break;
byteCnt += bytes;
// System.out.println(buffer);
fos.write(buffer, 0, bytes);
// flush the stream.
fos.flush();
} // end of try block.
finally
is.close();
fos.close();
// set last mod date for this file.
uploadedFile.setLastModified((new
Long(strLastMod)).longValue());
} // end of finally block.
} // end - the new file may be created on server.
} // end - we have a valid filename.
// set response headers.
resp.setContentType("text/plain");
resp.setStatus(status);
if (status != HttpServletResponse.SC_OK)
getServletContext().log("ERROR: " + message);
// get output stream.
PrintWriter out = resp.getWriter();
out.println(message);
} // end of doPost().
} // end of class FtpServerServletOK - the problem you describe is definitely what's giving you grief.
The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
You can use the following:
http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
on your server to get a feel for the format that the request headers need to take.
- Kevin
I get the out of Memory Error on the client side. I
was told that this might be a bug in the URLConnection
class implementation that basically it wont know the
content length until all the data has been written to
the output stream, so it uses an in memory buffer to
store the data which basically causes memory issues..
do you think there might be a workaround of any kind..
or maybe a way that the buffer might be flushed after
a certain size of file has been uploaded.. ?? do you
have any ideas? -
Out of memory error - from parsing a "fixed width file"
This may be fairly simple for someone out there but I am trying to write a simple program that can go through a "fixed width" flat txt file and parse it to be comma dilmeted.
I use a xml file with data dictionary specifications to do the work. I do this because there are over 430 fields that need to be parsed from a fixed width with close to 250,000 lines I can read the xml file fine to get the width dimensions but when I try to apply the parsing instructions, I get an out of memory error.
I am hoping it is an error with code and not the large files. If it is the latter, does anyone out there know some techniques for getting at this data?
Here is the code
import java.io.*;
import org.w3c.dom.Document;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
public class FixedWidthConverter{
String[] fieldNameArray;
String[] fieldTypeArray;
String[] fieldSizeArray;
public static void main(String args []){
FixedWidthConverter fwc = new FixedWidthConverter();
fwc.go();
fwc.loadFixedWidthFile();
//System.exit (0);
}//end of main
public void go(){
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File("files/dic.xml"));
// normalize text representation doc.getDocumentElement ().normalize ();
System.out.println ("Root element of the doc is " +
doc.getDocumentElement().getNodeName());
NodeList listOfFields = doc.getElementsByTagName("FIELD");
int totalFields = listOfFields.getLength();
System.out.println("Total no of fields : " + totalFields);
String[] fldNameArray = new String[totalFields];
String[] fldTypeArray = new String[totalFields];
String[] fldSizeArray = new String[totalFields];
for(int s=0; s<listOfFields.getLength() ; s++){
Node firstFieldNode = listOfFields.item(s);
if(firstFieldNode.getNodeType() == Node.ELEMENT_NODE){
Element firstFieldElement = (Element)firstFieldNode;
NodeList firstFieldNMList = firstFieldElement.getElementsByTagName("FIELD_NM");
Element firstFieldNMElement = (Element)firstFieldNMList.item(0);
NodeList textFNList = firstFieldNMElement.getChildNodes();
//System.out.println("Field Name : " +
//((Node)textFNList.item(0)).getNodeValue().trim());
//loads values into an array
//fldNameArray[s] = ((Node)textFNList.item(0)).getNodeValue().trim();
NodeList typeList = firstFieldElement.getElementsByTagName("TYPE");
Element typeElement = (Element)typeList.item(0);
NodeList textTypList = typeElement.getChildNodes();
//System.out.println("Field Type : " +
//((Node)textTypList.item(0)).getNodeValue().trim());
//loads values into an array
//fldTypeArray[s] = ((Node)textTypList.item(0)).getNodeValue().trim();
NodeList sizeList = firstFieldElement.getElementsByTagName("SIZE");
Element sizeElement = (Element)sizeList.item(0);
NodeList textSizeList = sizeElement.getChildNodes();
//System.out.println("Field Size : " +
//((Node)textSizeList.item(0)).getNodeValue().trim());
//loads values into an array
fldSizeArray[s] = ((Node)textSizeList.item(0)).getNodeValue().trim();
}//end of if clause
}//end of for loop with s var
//setFldNameArray(fldNameArray);
//setFldTypeArray(fldTypeArray);
setFldSizeArray(fldSizeArray);
catch (SAXParseException err) {
System.out.println ("** Parsing error" + ", line "
+ err.getLineNumber () + ", uri " + err.getSystemId ());
System.out.println(" " + err.getMessage ());
catch (SAXException e) {
Exception x = e.getException ();
((x == null) ? e : x).printStackTrace ();
catch (Throwable t) {
t.printStackTrace ();
}//end go();
public void setFldNameArray(String[] s){
fieldNameArray = s;
}//end setFldNameArray
public void setFldTypeArray(String[] s){
fieldTypeArray = s;
}//end setFldTypeArray
public void setFldSizeArray(String[] s){
fieldSizeArray = s;
}//end setFldSizeArray
public String[] getFldNameArray(){
return fieldNameArray;
}//end setFldNameArray
public String[] getFldTypeArray(){
return fieldTypeArray;
}//end setFldTypeArray
public String[] getFldSizeArray(){
return fieldSizeArray;
}//end setFldSizeArray
public int getNumLines(){
int countLines = 0;
try {
//File must be in same director and be the name of the string below
BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
String str;
while ((str = in.readLine()) != null) {
countLines++;
in.close();
catch (IOException e) {}
return countLines;
}//end of getNumLines
public void loadFixedWidthFile(){
int c = getNumLines();
int i = 0;
String[] lineProcessed = new String[c];
String chars;
try {
//File must be in same director and be the name of the string below
BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
String str;
while ((str = in.readLine()) != null) {
//System.out.println(str.length());
lineProcessed[i] = parseThatLine(str);
i++;
in.close();
catch (IOException e) {}
//write out the lineProcess[] array to another file
writeThatFile(lineProcessed);
}//end loadFixedWidthFile()
public void writeThatFile(String[] s){
try {
BufferedWriter out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
for(int i = 0; i < s.length -1; i++){
out.write(s);
}//end for loop
out.close();
catch (IOException e) {}
}//end writeThatFile
public String parseThatLine(String s){
int start = 0;
int end = 0;
String parsedLine = "";
int numChars = getFldSizeArray().length;
//Print number of lines for testing
//System.out.println(numChars);
String[] oArray = getFldSizeArray();
//String chars = oArray[0];
//System.out.println(chars.length());
//oArray
for(int i = 0; i < numChars -1; i++ ){
if(i == 0){
start = 0;
end = end + Integer.parseInt(oArray[i])-1;
else
start = end;
end = end + Integer.parseInt(oArray[i]);
parsedLine = parsedLine + s.substring(start, end) + "~";
}//end for loop
return parsedLine;
}//End of parseThatLine
I have tried to illeminate as many arrays as I can thinking that was chewing up the memory but to no avail.
Any thoughts or ideas?
Message was edited by:
SaipanMan2005You should not keep a String array of all the lines of the file read.
Instead for each line read, parse it, then write the parsed line in the other file: public void loadFixedWidthFile() {
BufferedReader in = null;
BufferedWriter out = null;
try {
//File must be in same director and be the name of the string below
in = new BufferedReader(new FileReader("files/FLAT.txt"));
out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
String str;
while ((str = in.readLine()) != null) {
//System.out.println(str.length());
str = parseThatLine(str);
//write out the parsed str to another file
out.write(str);
catch (IOException e) {
e.printStackTrace(); // At least print the exception - never swallow an exception
finally { // Use a finally block to be sure of closing the files even when exception occurs
try { in.close(); }
catch (Exception e) {}
try { out.close(); }
catch (Exception e) {}
}//end loadFixedWidthFile()Regards -
How can I solve out of memory error on excell file in PL/SQL
Hi,
I'm new on PL/SQL. One of the PL/SQL code which is created excell report got out of Memory error. The first reason of this error, excell file not supported more than 65536 data. So I change the excell file separeted sheets. So that the single sheet size cannot exceed 65536 data.
All the data are held on system cach and if many user want to take the report the they would get an out of memory error.
So I want to change the code like that; when out of memory exception raises,
the old excell file save to disk and new excell file is created,
and go on to write the new file without exiting the program.
At the end of the data all the excell file append and show only one file to the user.
I do know how to save the file and create a new file. But I don't know how can PL/SQL program to turn back to loop again when the exception occurs.
Is anyone help me on this issue?
Here is my code
Thank you
dworkbook:=hssfworkbook.new;
dCurrentItem := Get_Block_Property(pCurrentBlock, FIRST_ITEM);
while not (name_in('system.last_record')='TRUE') loop
/* The data would be written to the excell file column order. */
if (dRow=0) then
/* Create a new sheet */
elsif (dRow <= dMaxWorksheetNum) then
/* Data of the report are written here. The data are written in column order */
if (dRow > dMaxWorksheetNum) then
/* give dRow and dColumn intial value */
/* increase worksheet number */
end if; /* End of if (dRow=1) */
if (isWritten) and not name_in('system.last_record')='TRUE'then
/* if not at the end of the record and the previously read record is written to the file
, then go to next record */
next_record;
end if;
/* save excell report */
workbookwriter.save(dworkbook,global.gethome||dFileName);
web.show_document('/users/'||dFileName,'_BLANK');
/* when exceptions occurs */
EXCEPTION
WHEN ORA_JAVA.EXCEPTION_THROWN THEN
begin
javaException := ORA_JAVA.LAST_EXCEPTION;
-- Print out the Exception by using the toString()
-- Method of the exception Object
javaException2 := Exception_.new(javaException);
mess(27002,Exception_.getMessage(javaException2));
-- and clean up
ORA_JAVA.CLEAR_EXCEPTION;
exception
WHEN ORA_JAVA.JAVA_ERROR THEN
-- In this case, the error would be
-- Argument 1 can not be null
mess(27002,ORA_JAVA.LAST_ERROR);
--Clean up
ORA_JAVA.CLEAR_ERROR;
end;
WHEN ORA_JAVA.JAVA_ERROR THEN
-- In this case, the error would be
-- Argument 1 can not be null
message(ORA_JAVA.LAST_ERROR);
--Clean up
ORA_JAVA.CLEAR_ERROR;No need to double-post... most questions are answered pretty quickly...
-
Spooling to Text File - 30 million records - Getting Out of Memory Error
Hi All,
I have an extremely large oracle table that I need to spool to a .txt file. The table has approximately 30 million records. I'm using Toad For Oracle version 10.5 and I'm on Oracle 10g. I've tried running the following spool command a few times and it keeps crashing...I'm getting a "Out of Memory" error in my Toad window when I execute it as a script. Here's the code:
Spool on
set heading off
SET PAGESIZE 0
SET TRIMSPOOL ON
SET LINESIZE 100
set feedback off
set echo off
set termout off
Spool "C:\spooledtext.txt"
select
column1
from test_table
order by
column2,
column1
Spool off;
An ideas as to how I can get this query to spool to a text file without crashing and running out of memory?
Thanksuse sqlplus.
Or select smaller chunks and use copy to concat them afterwards.
Sybrand Bakker
Senior Oracle DBA -
Out of memory error with 80Kb file?
Hi, my pc has 2Gb of Ram, a page file that is setup correctly
and the physical ram is almost non-used (500Mb)
When I start DW and load a php file of 80Kb approx., it just
hangs/locks up. When I wait for it, it gives me an "out of memory"
error, and when you look in windows task manager, it just keeps
hogging up ram.
My laptop is a "simple", 1Gb Hp pavillion, and when I open
the file there, it just works like it's supposed to, using about
70Mb of ram, instead of the gigabyte(s) it does on my developer
machine....
Adjusting virtual memory has absolutely no effect.. It seems,
after some reading, that people using 2gb of ram, have the most
problems in this area?
Adobe, please help here !
EDIT: i just tested another file, 136Kb large, that loads
normal!, so it has to do with the files in specific... If you want
to test the files, just download "Simplemachines Forum" and load
the "load.php" or the "post.php" files from the source directory,
to trigger the lockup...mmm... just tried using a "workaround" if you still can call
it that
Installed a virtual machine (xp) with less than 2gigs, and it
works... I really hope someone else has got these kind of errors
yet.... 2500$ + software, wich I can't use for now... Using
notepad2 for time being... -
Acrobat XI Pro "Out of Memory" error after Office 2010 install
Good Afternoon,
We recently pushed Office 2010 to our users and are now getting reports of previous installs of Adobe Acrobat XI Pro no longer working but throwing "Out of Memory" errors.
We are in a Windows XP environment. All machines are HP 8440p/6930p/6910 with the same Service pack level (3) and all up to date on security patches.
All machines are running Office 2010 SP1.
All machines have 2GB or 4GB of RAM (Only 3.25GB recognized as we are a 32bit OS environment).
All machines have adequate free space (ranging from 50gb to 200gb of free space).
All machines are set to 4096mb initial page file size with 8192mb maximum page file size.
All machines with Acrobat XI Pro *DO NOT* have Reader XI installed alongside. If Reader is installed, it is Reader 10.1 or higher.
The following troubleshooting steps have been taken:
Verify page file size (4096mb - 8192mb).
Deleted local user and Windows temp files (%temp% and c:\WINDOWS\Temp both emptied).
Repair on Adobe Acrobat XI Pro install. No change.
Uninstall Acrobat Pro XI, reboot, re-install. No change.
Uninstall Acrobat Pro XI Pro along with *ALL* other Adobe applications presently installed (Flash Player, Air), delete all Adobe folders and files found in a full search of the C drive, delete all orphaned Registry entries for all Adobe products, re-empty all temp folders, reboot.
Re-install Adobe Acrobat XI Pro. No change.
Disable enhanced security in Acrobat XI Pro. No change.
Renamed Acrobat XI's plug_ins folder to plug_ins.old.
You *can* get Acrobat to open once this is done but when you attempt to edit a file or enter data into a form, you get the message, "The "Updater" plug-in has been removed. Please re-install Acrobat to continue viewing the current file."
A repair on the Office 2010 install and re-installing Office 2010 also had no effect.
At this point, short of re-imaging the machines (which is *not* an option), we are stumped.
We have not yet tried rolling back a user to Office 2007 as the upgrade initiative is enterprise-wide and rolling back would not be considered a solution.
Anyone have any ideas beyond what has been tried so far?As mentioned, the TEMP folder is typically the problem. MS limits the size of this folder and you have 2 choices: 1. empty it or 2. increase the size limit. I am not positive this is the issue, but it does crop up at times. It does not matter how big your harddrive is, it is a matter of the amount of space that MS has allocated for virtual memory. I am surprised that there is an issue with 64GB of RAM, but MS is real good at letting you know you can't have it all for use because you might want to open up something else. That is why a lot of big packages turn off some of the limits of Windows or use Linux.
Maybe you are looking for
-
Hi, I am facing a issue with an inbound purchase order change IDOC (message type: PORDCH). I am getting the following error: FM VENDOR_MASTER_DATA_SELECT_15 ; no partner functions found for vendor VENDOR_MASTER_DATA_SELECT_15 1. The vendors are c
-
I have a macbook pro w/OS V10.9.5; I've downloaded acrobat reader XI for mac (I've also installed Micrsort office XI for mac). PDF files won't open for reading; videos of granddaughter from daughter's iphone won't play...two separate problems. He
-
Thinkpad yoga 14 Fix I discovered
Hello, To geeksquad repair techs or customers savvy with a soldering iron, I just wanted to present the fix I figured out to the ever-so-frustrating problem on the Thinkpad yoga 14 where the laptop would power off when disconnected from AC power and
-
Being offered 6.0-beta as a "security and stability" update from 5.0-stable
My Mac is, or should be, on the -stable channel for Firefox updates, yet I am being offered an upgrade from 5.0-stable to 6.0-beta rather than to 5.0.1. about:config has "beta" in app.update.channel, and labels this "default" rather than "user set" -
-
Would like purchase movies and some tv shows from another countries itunes store, but not sure if they will work on my US itunes account. Keith