I honestly don't know if this is the right place to put this, but after much searching, head banging, and thinking I found a solution to a problem which came up when I started using knockout and I would like to share it somewhere so I can perhaps save someone a little time.
I was tasked by my boss to try out a few javascript frameworks since our projects were getting more and more complex and the javascript was becoming unmanageably huge for some projects. During this process I discovered knockout and its pretty much changed the entire way I think about javascript and coding web applications. However, I ran into a problem when I started using very large datasets: my memory usage per page would be absolutely horrendous. The documentation and tutorials on the knockoutjs website don't cover in huge depth ajax saving and such and along with my naivety in relation to things javascript and memory usage I ended up being totally stumped when I spied my page running at 800Mb with a thousand or so elements being displayed (no images). Google was no help since I didn't even know what my problem was (I thought it was memory leaks due to circular references between page elements and javascript objects, but using the 'if' binding to actually remove the elements to break the cycle didn't fix anything) and so after thinking about it for a couple months, over the past few days I have finally figured out that the problem was in how I structured my model.
I've written a post about how to solve knockout memory problems when loading large datasets and how
not to structure a knockout-based ajax application. It is here:
http://cuznersoft.com/wordpress/?p=208Does anyone have any thoughts, feedback, or insights on the topic of knockout memory usage? Maybe things I should add to my post? Mistakes and incorrect assumptions I have made?
Thanks.