Added some more tests to test the memory cost of lambda, and customized function

Added some more tests to test the memory cost of lambda, and customized function