471,336 Members | 1,263 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 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 1598
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Christoph | last post: by
8 posts views Thread by ranjeet.gupta | last post: by
17 posts views Thread by José Joye | last post: by
4 posts views Thread by Don Nell | last post: by
20 posts views Thread by jeevankodali | last post: by
23 posts views Thread by James | last post: by
1 post views Thread by scot.haynes | last post: by
3 posts views Thread by Jim Land | last post: by
22 posts views Thread by Peter | last post: by

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.