shawn wang <shawn.wang...@gmail.com> writes: > I have successfully registered my patch for the commitfest. However, upon > integration, I encountered several errors during the testing phase. I am > currently investigating the root causes of these issues and will work on > providing the necessary fixes.
I should think the root cause is pretty obvious: malloc_trim() is a glibc-ism. I'm fairly doubtful that this is something we should spend time on. It can never work on any non-glibc platform. Even granting that a Linux-only feature could be worth having, I'm really doubtful that our memory allocation patterns are such that malloc_trim() could be expected to free a useful amount of memory mid-query. The single test case you showed suggested that maybe we could usefully prod glibc to free memory at query completion, but we don't need all this interrupt infrastructure to do that. I think we could likely get 95% of the benefit with about a five-line patch. regards, tom lane