memory leak from d3js javascript - memory

I made chart which is similar with this chart.
when I keep clicking 'make random data' button, browser memory keep increasing.
how should I take this down.

Related

Delphi: scrolling whilst running real time

I have implemented a Scroll box that dynamically adds TCharts dependent on the number of channels available on an input device. The charts repaint on a loop to show the value of the voltage through the channel, so that the display outputs effectively a "real-time" view of the voltages being applied to each channel.
Currently I have an Application.ProcessMessages function to prevent the application becoming unresponsive during a run, but I would like to be able to scroll through the box whilst the channels are being displayed, without disturbing the display, which currently pauses whilst the scroll bar is clicked.
Is this possible?
Yes, this is possible.
The charts repaint on a loop ...
Repaints driven by an own loop indeed ensures respiratory distres on the system, which exactly is the reason for the need of Application.ProcessMessages. Try not to use it. Instead, you should just ask the charts to repaint themselves with Invalidate when new data comes in, and let the system decide when it is convenient to do so.

Openlayers-3 forEachFeatureAtPixel slightly offset

I'm currently using 3.6.0 and I'm finding that, as features are placed from left to right on the map that features further to the right seem to be offset from their icons - if I place my mouse directly over the graphic feature the mouse cursor (which is wired up to forEachFeatureAtPixel()) does not change until it is moved to the left of the feature icon. On the left of the screen they line up, but it drifts going right until features on the right are completely out of sync.
Any ideas? I thought it may be the library, but I've just rolled back to 3.4.0 and it was the same.
Could this be layout outside of the map canvas bumping items across the screen?
I had the same issue for about a month but in my particular case the problem originated because I was rendering the map while showing a loading panel in front of it wich had a style that caused the web browser to display the scrollbars.
Upon load completion, hiding the loading panel also removed the scrollbar but somehow the map itself didn't refresh properly.
All I had to do was to force map to recalculate the viewport size using the map.updateSize()
http://openlayers.org/en/v3.14.0/apidoc/ol.Map.html#updateSize

Highcharts Doesn't Refresh at Colorbox but Automatically Refreshes When Inspected at Firebug

I have highcharts graphic at my main HTML. I put it in a small div so some parts of graphics is not showed. When user clicks a button it opens at colorbox as a popup however doesn't refresh its size. When I click to inspect with Firebug it suddenly refresh its size and everything is normal. When I close colorbox it it still big and I can not see many part of the graphic too.
Is there any idea about how to refresh Highcharts graphic and why it is refreshing itself(what I want) just when I click inspect element with Firebug?
PS: It works when I resize the windows not related to Firebug. There is something here seems same problem with mine: https://github.com/highslide-software/highcharts.com/issues/472
I called window.resize after data loaded and after colorbox closed, it solved the problem.
Without an example to look at its hard to tell, but here is what I think is happening:
First check if the option reflow is set to true. If it is then Highcharts will monitor window.resize events and redraw itself when a resize occurs. My guess is that when activating Firebug, the window is resized and the chart is redrawn.
If you want to manually set a new size of the chart you can use the api method setSize(). To only redraw the chart you should use redraw().

Why is JqueryUI's button slow in IE?

I've been tracking down a performance problem in one of our javascript app (in IE, to make matter worse) and I was able to track it down to jQueryUI button feature. I've created a jsfiddle showing the issue. The problem is 3 parts:
First, the generation of the buttons is extremely slow. The page generates 800 buttons in 5+ seconds under IE8, whereas it takes around 700ms when I disable the button feature. To make it worse, it gets slower and slower for every create/delete cycle. For comparison, in Chrome it takes less than a second (around 600ms) with the button feature and around 50ms without it. That's a 10x slow down for both browser!
Second, deleting/destroying all those button is also slow. I use the empty() method on the container to clean all the buttons and that ultimatly calls destroy on the button. This operation takes around 5 seconds under IE8 and 500ms in Chrome. Once I remove the jquery button feature, it takes 200ms in IE8 and 30-40ms in Chrome. That's a 20x slow down, worse than generating the button themselves.
Third, it seems that the button feature causes a huge memory leak in IE. Repeatedly creating and deleting the buttons result in the memory usage going up and up, but once again removing the button feature fixes this.
Can anyone explain this behaviour? Is this a performance problem in jQueryUI that should be reported or am I hitting a pitfall? Any workarounds?
Note: when I say i remove the button feature, it's not that I remove the <button> element from the document, it's just that I remove the call to jqueryUI's button function:
.button({
'text': true
})

Is Flash Player "Low quality" setting only about anti-aliasing?

It not just my curiosity, recently I've received a bugreport concerning one of my AS3 applications. This bug can be reproduced only if the quality in flash player is set to LOW (HIGH/MEDIUM - everything is ok). The bug changes the application behaviour, but it's a mystery for me, why it happens only for LOW quality while quality is said to influence rendering and visual appearance, not the code or behaviour.
Briefly, I have a menu panel (MovieClip) with several items (also MovieClips). Very simple, it appears on a screen after a MouseEvent and a user moves a cursor from one element down to another. When the cursor reaches the edge of the second item, the menu suddenly disappears.
In my code panel hiding is set on mouse click or mouse out.
Personally, I think, that the problem is in Tweener, I have to use that old piece of code. The menu panel is shown when mouse is above a user icon, and concurrently with the help of Tweener I produce some simple effects on this icon.
I have explored adobe and firefox (my app is for web browsers and the bug is reported for firefox) bugtrackers, but so far I have found nothing. Maybe misbehaviour of flash player 11 with Arrays, already fixed... I've run out of ideas.
From the docs:
LOW
Specifies low rendering quality: graphics are not anti-aliased, and bitmaps are not smoothed.
If it only happens when rendering it set to low, then it's probably a timing issue - i.e., the bug has always been there, but because you're wrapping up rendering earlier, you can trigger then bug. Is the bug reporter's computer a slow one? Is there a lot happening at once? Is the menu being removed, set to invisible, or repositioned?
Like #jeremynealbrown said, try and separate out your class to a simple project to make sure there's nothing wrong with your logic there.
Another method, override the removeChild() method, and visible and x and y properties to see which one is setting it, then put traces before all calls that call these to see what's triggering it.
If you think the problem is in Tweener, add a MOUSE_OVER listener to the menu panel that calls something like removeAllTweens(), no matter the state of the menu panel. If the bug doesn't happen anymore, this will show you that it's related to the tween engine.

Resources