>I tried to feed 1.5Mb email message to Header(), it consumed about !Gb
>of memory and them was killed:
>string = read('email_message').decode('utf-8')
>Could you please tell where to look to find a solution for this issue ?
Start with the documentation. The Header() constructor accepts a single
header value, not an entire email message. the decode_header function
also accepts a single header value, not a Header instance.