0 votes

Hi,
I wanted to download all headers data and 1 year of body html from gmail using imap. I have over 3 lacks of mails.
So initially I'm getting all headers using:

List infos = imap.GetMessageInfoByUID(uids);

Then I'm preparing List and keeping 1 year of html data using following method:

imap.GetTextByUID(MimeStruct); (Here MimeStruct is a LIST which contains 1 year of bodystructure HTML.

But When I see in the task manager, the memory it consumes get increasing even over 1.5 GB and after sometime the program is getting crashed with message "System Out of Memory). So is there any solution to fetch all headers and bodystructure using less memory.

Thanks,
Sarathi

by (1.4k points)
So is there any method to download n number of headers and then process and again download n number and process using limilabs.

1 Answer

0 votes

It doesn't seem like an issue with the component.
You are downloading monstrous amount of data and keeping it directly in memory.
Sooner or later you'll get an out-of-memory exception.

The answer is simple: Don't download so much data to memory.

by (297k points)
...