473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sarissa, memory leak

I have a memory leak happening... I believe it is due to Dom parser...
could anyone help me with this: Do I need a delete???

///////////////////////////////////////////////
//Code on Main HTML page:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" SRC="Engine.js" ></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="Sarissa.js" </SCRIPT>
</head>
<body>
<script type="text/javascript">

rXML = ' <CLS <Name>John</Name <GPA>43</GPA </CLS>';
var cXML = ' <CLS <Name>Sam</Name <GPA>43</GPA </CLS>';

var pro = new InitRankEngine(cXML);
document.write('<BR' + pro.EngineRank(rXML) );
</script>
</body>
</html>

///////////////////////////////////////////////////////////////////////////////////////////
//Code in the Engine.js
// defining the class
function InitRankEngine(XML)
{
// initialize the member variables for this instance
this.XML = XML;

this.pXML = Sarissa.getDomDocument();
this.pXML = (new DOMParser()).parseFromString(this.XML, "text/xml");

// initialize the member function references for the class prototype
if (typeof(_InitRankEngine_prototype_called) == 'undefined')
{
_InitRankEngine_prototype_called = true;
InitRankEngine.prototype.EngineRank = EngineRank;
}

function EngineRank(sXML)
{
var sTmp = '';
var posXML = Sarissa.getDomDocument();
posXML = (new DOMParser()).parseFromString(sXML, "text/xml");

sTmp = this.CalcRank(posXML, this.pXML, 1, 1);

// delete(posXML);
return sTmp;
}

function CalcRank(posXML, profXML, calcMatch, usePosFactors)
{
var SecScore = 0;
try
{
iFir = profXML.selectNodes("//GPA/text()")[0].nodeValue;
iSec = posXML.selectNodes("//GPA/text()")[0].nodeValue;
SecScore = 5;
}
catch(err)
{
}
return SecScore;
}

}

Sep 15 '06 #1
2 1710
VK

ri*******@hotmail.com wrote:
I have a memory leak happening...
How do you define a memory leak? Are you getting "Out of memory"
message?. The system gets lesser responsive / stops to respond after N
minutes?

P.S. Did you try to contact Sarissa producers with your problem?

Sep 16 '06 #2

VK wrote:
ri*******@hotmail.com wrote:
I have a memory leak happening...

How do you define a memory leak? Are you getting "Out of memory"
message?. The system gets lesser responsive / stops to respond after N
minutes?

P.S. Did you try to contact Sarissa producers with your problem?
On my page, there is grid that shows 100 records. At a push of a
button, all these records get ranked by the code that is shared. The
reason I say there is memory leak is cause every time the RankButton is
pressed, The "Memory Usage" and "PeakMem Usage" column in the task
manager shows more and more memory utilization. Plus the same
calculation takes more and more time... as the mem utilization
increases. I have yet to see a response stop. though... probably cause
I'm running with 1Gig of RAM.
I've not contacted the Sarissa producers, as yet... I was hoping that
the Gurus of this site will be able to help me resolve this issue.

Sep 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christoph | last post by:
Hello, I found the following XHTML document for testing sarissa's XPath implementation at http://sarissa.sourceforge.net/doc/. I replaced "Sarissa_0-9b3.js" in the test document below by...
8
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? ...
17
by: José Joye | last post by:
Hi, I have implemented a Service that is responsible for getting messages from a MS MQ located on a remote machine. I'm getting memory leak from time to time (???). In some situation, it is...
4
by: Don Nell | last post by:
Hello Why is there a memory leak when this code is executed. for(;;) { ManagementScope scope = new ManagementScope(); scope.Options.Username="username"; scope.Options.Password="password";...
20
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex...
23
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
1
by: scot.haynes | last post by:
Can anyone help me with the following problem I'm having using the Sarissa parser. I am running the following java script var xml = Sarissa.getDomDocument(); xml.async = false; //Load my xml...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
22
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.