Hello,<div>I&#39;m trying to allow RGB images as buttons in XMonad. It&#39;s alreasy working, but now XMonad leaks a lot of memory (each time you change focus about 1 or 2 megabytes are taken from memory), so when a little time passes, it becomes unusable. I&#39;d like to ask for help profiling or with any other thing that may help me solve this problem.</div>

<div><br></div><div>As of now, I&#39;m saving the images as String. Then, using Foreign.C.String.newCAString, I convert it to a CString, which is what Xlib expects. After that, I create a Image using XCreateImage, which I paint using XPutImage. Finally, I call XDestroyImage to free the memory. So, as far as I know, no leak should be possible :(</div>

<div><br></div><div>Thanks in advance.</div>