I'm not able to see an issue with the piece of code that you have pasted here. Maybe you could open a bug report with halcust attached and repeatable situation that I can look at?
Hi,
No changes should have been made that would increase client's HDB file. Please try to delete HANSA.HDB from client folder and reconnect to server and check if it will grow to 30MB again.
...