Are you certain that the error is a javascript error as you say? Since if it is then why do you show us how the javascript is generated and not the final generated javascript function. The jstl part may of course be relevant (since it shows how you create the javascript function) but the final result is needed to see why the javascript is not valid.
If on the other hand you meant that the jstl is invalid then someone may help you with the code and see where you went wrong.
What values do "snapShotDate" and "freeMemory" have? Since they're not in quotes in the JavaScript code, they could only be numbers (or you'll get errors).
Don't get me started about those stupid light bulbs.