Why does my SQL Server show more than half a million active tasks?
This is a bug in SQL Server 2012. Details of a hotfix are at

FIX: A memory leak occurs when you enable AlwaysOn Availability Groups or SQL Server failover cluster in Microsoft SQL Server 2012