Is it necessary to unsubscribe from observables created by Http methods?

So the answer is no, you don’t. Ng2 will clean it up itself. The Http service source, from Angular’s Http XHR backend source: Notice how it runs the complete() after getting the result. This means it actually unsubscribes on completion. So you don’t need to do it yourself. Here is a test to validate: fetchFilms() … Read more

If a DOM Element is removed, are its listeners also removed from memory?

Modern browsers Plain JavaScript If a DOM element which is removed is reference-free (no references pointing to it) then yes – the element itself is picked up by the garbage collector as well as any event handlers/listeners associated with it. var a = document.createElement(‘div’); var b = document.createElement(‘p’); // Add event listeners to b etc… … Read more

What is private bytes, virtual bytes, working set?

The short answer to this question is that none of these values are a reliable indicator of how much memory an executable is actually using, and none of them are really appropriate for debugging a memory leak. Private Bytes refer to the amount of memory that the process executable has asked for – not necessarily … Read more

Dealing with “java.lang.OutOfMemoryError: PermGen space” error

The solution was to add these flags to JVM command line when Tomcat is started: -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled You can do that by shutting down the tomcat service, then going into the Tomcat/bin directory and running tomcat6w.exe. Under the “Java” tab, add the arguments to the “Java Options” box. Click “OK” and then restart the service. … Read more

performSelector may cause a leak because its selector is unknown

Solution The compiler is warning about this for a reason. It’s very rare that this warning should simply be ignored, and it’s easy to work around. Here’s how: if (!_controller) { return; } SEL selector = NSSelectorFromString(@”someMethod”); IMP imp = [_controller methodForSelector:selector]; void (*func)(id, SEL) = (void *)imp; func(_controller, selector); Or more tersely (though hard … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)