Sarissa, memory leak

R

rizjabbar

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;
}

}
 
V

VK

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?
 
R

rizjabbar

VK said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top