Platform: Windows 2000, IE6, msxml 4
Language: Javascript, client-side
<Problem>: I'm using the xmldom.load() function to load a .xml file from a
remote server. But i require to constantly poll the server as the data is
updated. Say for example, in second 1 I pull down the last appended node, in
second 2, I appended a new node using xml.save server-side (asp.net), so in
second 3 I need to detect that a new node has been appended and pull it
down - I do this by using a setInterval(... load(), 1000).
Now in theory - and in fact practice - this works, and I've got a simple
system working to continually update the client, but my problem is this:
after a number of pollings of the server the client slows down to a creep -
and eventually becomes useless. In my mind I'm either overflowing the stack,
as on each new .load() its just appending to the memory, or javascripts
garbage collection isnt efficient enought to cope (which effectively results
in the same thing).
<Question>: What techniques does anyone suggest to clear out the memory (I
know Javascript doesn't support anything close to memory management), but by
not explicitly declaring my varibles, would I be able to use the "delete"
operator?
<Question>: Or can someone suggest a more elegant way to poll the server for
updates? I was thinking about using ondataavailable , but this is only used
for objects being loaded, rather than objects that are effectively in a
continual state of flux.
I would post code, but its currently under copyright.
matt
Language: Javascript, client-side
<Problem>: I'm using the xmldom.load() function to load a .xml file from a
remote server. But i require to constantly poll the server as the data is
updated. Say for example, in second 1 I pull down the last appended node, in
second 2, I appended a new node using xml.save server-side (asp.net), so in
second 3 I need to detect that a new node has been appended and pull it
down - I do this by using a setInterval(... load(), 1000).
Now in theory - and in fact practice - this works, and I've got a simple
system working to continually update the client, but my problem is this:
after a number of pollings of the server the client slows down to a creep -
and eventually becomes useless. In my mind I'm either overflowing the stack,
as on each new .load() its just appending to the memory, or javascripts
garbage collection isnt efficient enought to cope (which effectively results
in the same thing).
<Question>: What techniques does anyone suggest to clear out the memory (I
know Javascript doesn't support anything close to memory management), but by
not explicitly declaring my varibles, would I be able to use the "delete"
operator?
<Question>: Or can someone suggest a more elegant way to poll the server for
updates? I was thinking about using ondataavailable , but this is only used
for objects being loaded, rather than objects that are effectively in a
continual state of flux.
I would post code, but its currently under copyright.
matt
Comment