Indeed, SQL server suddenly used all the assigned memory :
This is pretty much normal and expected, you found out there was low physical memory, you added physical memory and changed max server memory setting now SQL Server can see it has been allowed to use extra memory so it went ahead and grabbed all of it. This would help SQL Server in making things faster when new memory requirements comes because it has already cached memory the new process requiring memory would get that immediately.
I have a good book which say :"Once memory usage has increased beyond the min server memory setting, SQL Server won't release any memory below that amount" - Is the same thing happening here with max server memory ?
Although this is correct but not actually related to what you are seeing. What above says is min server memory is point upto which SQL Server will try to trim down its memory consumption in case of memory pressure what you are seeing is default behavior of SQL Server when more memory is available.
I'm wondering (again) how to measure how much memory SQL is really using. I'm confused with the parameter "Total server memory (KB)" ("this counter measures SQL Server's total buffer pool usage").
If you are using SQL Server 2008 and above easy way to see how much memory SQL Server is using is by querying DMV sys.dm_os_process_memory
from sys. dm_os_process_memory
Phy_Memory_usedby_Sqlserver_MB-- Gives total Physical memory used by SQL Server in MB
Total_Memory_UsedBySQLServer_MB-- Gives total memory(RAM+Page file) used by SQL Server in MB
I can also see you are using Task Manager to see SQL Server memory utilization, DON'T use task manager as it will not show correct memory utilized when Locked pages in memory privilege is assigned to SQL Server service account
Total Server Memory: This is simply total memory used by SQL Server BUT this does not tracks ALL memory used and might miss few MB's and this is where DMV comes into picture so always rely on query I have posted.
Now if you see the scale on which you measured Total Server memory is 0.0001 in that case whatever value you are getting you have to multiply it by 10000 to get the value on scale of 1 which is what you need. I cannot see how you got 2 MB can you show it to me.
Long Back I wrote article on SQL Server Memory and Troubleshooting, this should get you started about basics on SQL Server Memory management.
If you are using SQL Server 2012 and above you must read
Leaving enough RAM for OS and ESX in your case is important. If you want to set ideal value for max server memory here is the stackexchange Link