Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] RAM Usage Optimization

On Sat, 2019-01-12 at 06:13 +0000, Nathan Ridge wrote:
Hi Adrian,

One of the current problem we are concerned with is that the projects 
complexity increases and the RAM needed for the indexer is scaling 
with them.

I have noticed this as well.

I assume the cause is the incapability of the GC to free the memory as 
fast as new objects are allocated (a manual GC clears the RAM used, but 
a few seconds later it is filled again).

I haven't investigated the matter enough to comment on the cause. I 
would hesitate to draw conclusions based on assumptions.

Considering the above, would you allow refactorings like the following?

for (int i =0; ; i++) {
    char[] charrArray = new char[1000];

char[] charrArray;
for (int i =0; ; i++) {
    charrArray = new char[1000];

If yes, I'm willing to do the refactorings myself and benchmark the changes.

I would be surprised if a refactoring like the above made a difference. It
seems to me that the JVM should already treat the above two snippets 

+1. Going back in time, the move from String to char[] actually didn't save us much either and one of the regrets I have. Java is really good and fast at small object allocation and garbage collection.

That said, if benchmarks show that a change like the above really does
make a difference, I don't see why we wouldn't accept it, assuming it
preserves functionality, and preserves readability to the extent the above
example does.

And +1 here too. We're always looking for improvements in performance. I do worry though that some of it is just a nature of the game. I notice cquery isn't super fast at indexing of large projects either. But yes, anything that shows improvement would be great. Thanks!

cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top