in reply to modules and memory usage

If you really care about memory consumption, the best thing to do is not import any symbols at all from the module by passing an empty list: use Socket ();

Then you can just access functions by using fully-qualified names. Any symbol you import will take up more memory than this.