I just started playing Avorion a couple of days ago and I had also terrible fps and horrible lag that usually started after a pirate/alien fight happen or some serious building.
I tried to just restart the game, that worked okay until next fight or heavy building and then all goes bad again. Tried a clean installation of Avorion, same bad fps and lag once a fight or some custom building was done.
By curiosity, I tried to OPT IN to the latest beta version instead and now ALL problems are gone. So the v0.30 will probably fix this issues. So please try to opt in to the beta by right click on the game in steam -> properties -> beta -> choose "Beta Newest changes" in the dropdown and let steam download the updates for Avorion.
Before I opted in to the beta, when Avorion started to lag and drop all fps it used between 9-12 GB of RAM, now it never uses more than maybe 4 GB and my FPS keeps steady around 90-120 on
CPU: Intel Core i5-7300HQ @ 4x 3.5GHz
GPU: GeForce GTX 1060
RAM: 16 GB
And all settings between medium-high.