CGI Interview Question

Memory management in Spark,how do we handle this