Added support for #G in memory_limit

Also support lowercase k, m and g characters instead of upper case, also for memory_limit.