I tested your app and confirm that the TIpHtmlPanel is not only extremely wasteful of memory, but also extremely slow. Click the Add 100 Lines button took about 10 seconds and bumped Real Memory use by about 140K / line added. Also, during this wait, the rotating ball came on and the CPU % pegged 100% in Activity Monitor.
I think you're just using the wrong tools. Maybe forget the cross-platform UI and focus on getting what you really want.
Well, I suspect part of the reason that CPU was so high was the call to htmlChat.Update and the scrollbar moving command was in the loop. It isn't really necessary to call these every loop. I only provided a 100 line adder so the memory usage could be easily seen. I don't ever use this functionality. If you remove those and only call them once at the end, it should help a little. After I did that it was still at 61% CPU usage and one second or so delay on my machine. Additionally, you could throw a Application.ProcessMessages in there in the loop and your computer wouldn't beach-ball.
I'm glad you saw what I was seeing. It's too bad you don't know what is causing the crazy memory usage either.
I was looking for something cross-platform because I didn't want to have to code something twice or three times any time I make some changes. When I used to use TRichMemo I kept having to do this, as the control while working on all three major platforms, did not work consistently on them and individual code had to be created for each. I recall it being annoying. I also recall it being problematic because I tend to catch bugs best when testing my program on my platform. With TRichMemo sometimes I wouldn't catch bugs as quickly as normal because Windows-only bugs would crop up because the code wasn't consistent across all platforms.
That said, I'm also saddened by the weird memory usage issues of TIpHtmlPanel, because other than that it pretty much is perfect for me. Fonts using it even look nice on Windows, which has horrible font rendering most of the time in many default controls. Also, executable size isn't all that relevant to anything and while it's great that WebView can add lines fast, my program will almost exclusively add one at a time.
That said, I would consider using WebView if it can be used in Lazarus, but that presents its own issues. First, I have no real idea how native Mac widgets which are part of Mac API's integrate with Lazarus. If you were suggesting I redo what I'm doing in Xcode instead of Lazarus, that is not possible. This chat component is part of a much larger cross-platform program written in Lazarus. The chat of it is a lot like the demo, but the chat code is a page and the program is a novel. If you know how to use WebView in Lazarus, let me know and I'll at least take a look.
However, even if I did so that only solves about 10% of my issue, because while I am on a Mac, 90% of my users are on Windows. So, again, I would need another component for Windows that does the exact same thing including links, colored text, and maybe images. Then, when I add some more advanced features to the chat later (hovering over certain key words that have programatic effects), I'd have to code it twice, or three times if I have Linux working by then.
So it's more work, but I'm open to it if it could work better. The big two problems for me with going that route are:
1. How do I use WebView in Lazarus?
2. What do I use to do HTML RichChat on Windows then?