By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Sarissa, memory leak

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.