Jag försöker bygga en sökmotor som ska klara av att söka genom dokument. Till min hjälp har jag komponenter som: Hur mycket minne använder ASP.NET? Det kan uppstå problem med OutOfMemoryException när man börjar komma upp i runt 2 Gb, oavsett hur mycket minne man tryckt i burken (se http://joakimsunden.blogspot.com/2006/02/outofmemoryexception-i-aspnet-trots.html). Servern har 768mb Ram Minne, ca 500 av det ledigt. Asp.Net tar ca 40 Mb. Läste igenom artiklarna, men inget hjälpte :/ Vilken version av .NET Framework kör du på W2000-maskinen? Om det är 1.0 kan det handla om följande bugg: Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573Not enough storage is available
* www.dotlucene.com som sökmotor
* www.wordcnv.com för att göra om dokument till ren text
Det funkar utmärkt på XP, maskiner men på en Win 2000 (SP4) så får jag förjande fel:
<info>
Not enough storage is available to complete this operation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Not enough storage is available to complete this operation.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OutOfMemoryException: Not enough storage is available to complete this operation.]
ImpTool.indexera.AddDocument(String path, Int32 DocID)
ImpTool.indexera.GetFiles(Int32 masterProcessId, OrderByColumn column)
ImpTool.indexera.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
</info>
2000 maskinen har 800 mb ledigt på hårdisken och runt 500 mb Ram ledigt...
Antar att det inte har nått med koden att göra, men skickar iväg den endå:
public void AddDocument(string path, int DocID)
{
Document doc = new Document();
string rawText = "";
string fileName = "";
ZipInputStream s = new ZipInputStream(File.OpenRead(path));
ZipEntry theEntry;
while ((theEntry = s.GetNextEntry()) != null)
{
fileName = this.MapPath("\\") + "tmp";
FileStream streamWriter = File.Create(fileName);
int size = 2048;
byte[] data = new byte[2048];
while (true)
{
size = s.Read(data, 0, data.Length);
if (size > 0)
{
streamWriter.Write(data, 0, size);
}
else
{
break;
}
}
streamWriter.Close();
}
s.Close();
DocCom.DocCom doctxt = new DocCom.DocCom();
DocCom.OutPutStruc pStructure = new DocCom.OutPutStruc();
switch ((docErrorType)doctxt.GetText(fileName, ref pStructure))
{
case docErrorType.doc_OK:
rawText = pStructure.pTitle +" ";
rawText += pStructure.pText;//pStructure.pAuthor;
//label2.Text = pStructure.pAuthor;
//Form1.ActiveForm.Text = pStructure.pTitle;
break;
case docErrorType.doc_Encrypted:
rawText = "Sorry, encrypted documents are not supported";
break;
case docErrorType.doc_Unsupported:
StreamReader stream = new StreamReader(fileName);
rawText = stream.ReadToEnd();
stream.Close();
break;
case docErrorType.doc_Corrupted:
rawText = "Sorry, the document is probably corrupted";
break;
}
lblTest.Text += path +"<p>";
doc.Add(Field.UnStored("text", rawText));
doc.Add(Field.Keyword("path", path));
doc.Add(Field.Keyword("type", "d"));
doc.Add(Field.Keyword("DocID", DocID.ToString()));
writer.AddDocument(doc);
File.Delete(fileName);
}
Sv: Not enough storage is available
Sv:Not enough storage is available
Sv: Not enough storage is available
OutOfMemoryException Occurs When You Access Non-Fixed Size Safe Arrays in a User-Defined Type
http://support.microsoft.com/?kbid=327107
I så fall löser du problemet genom att uppgradera till .NET Framework 1.1.Sv:Not enough storage is available