I have written the following function using the HaskellNet and HaskellNet-SSL libraries.
Using the "fetch" function results with memory usage blowing up and extreme swapping.
What am I doing wrong? Might it be a bug?
import qualified Data.ByteString.Char8 as SB8
import Network.HaskellNet.IMAP
import Network.HaskellNet.IMAP.SSL
main = retrieveCSV
retrieveCSV = do
con <- connectIMAPSSL imapServer
login con username password
select con mailbox
lastMsg <- last <$> search con [ALLs]
-- this works:
_ <- fetchHeader con lastMsg
-- this works:
_ <- fetchSize con lastMsg
-- this blows up in memory usage:
_ <- fetch con lastMsg
undefined
where
imapServer = "imap.gmail.com"
username = "example" -- imagine this username is real
password = "example" -- imagine this password is real
mailbox = "example" -- imagine this mailbox is real
Reposting from https://github.com/jtdaugherty/HaskellNet/issues/39:
I have written the following function using the HaskellNet and HaskellNet-SSL libraries. Using the "fetch" function results with memory usage blowing up and extreme swapping. What am I doing wrong? Might it be a bug?