A few approaches, from simple to precise: http://www.huyng.com/posts/python-performance-analysis/
If you can import but you don't want to pip install:
http://pythonforbiologists.com/index.php/measuring-memory-usage-in-python/
Suggestions for reading large files: http://stackoverflow.com/questions/12039235/loading-large-file-in-python
Alternatives to reading large files: