BitShares Forum

Other => Graveyard => MemoryCoin => Topic started by: FreeTrade on December 19, 2013, 10:29:58 am

Title: Linux Crashes
Post by: FreeTrade on December 19, 2013, 10:29:58 am
Update: these seem to be mostly resolved. The option mentioned below doesn't seem to be useful.

I've updated the source with a new option. You can now run with the
-useevp=0

This will switch off the EVP library, which may be the source of a memory leak.

The EVP library is what allows the AES-NI instructions, so performance will be slower. You won't want to use this if you're mining, but for a node or a block explorer, this should cut out the memory-leak crashes.

Let me know how it works out.
Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 19, 2013, 05:12:51 pm
I do not know about others but this did not help me.  The memory leak was much slower, however it was still present when using the -useevp=0 option.

My hash/min went down to about 1/6th what it was before and the speed of the leak slowed down about an equal amount.  This was on Ubuntu 13.10.  So at least for this dist it appears as though EVP is not the source of the leak. 
Title: Re: Linux Crashes - new option -useevp=0
Post by: FreeTrade on December 19, 2013, 05:17:48 pm
Okay, thanks for testing that out. So the leak might be in the underlying openssl, or elsewhere.
Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 19, 2013, 07:49:45 pm
In digging a little further into this I have found I can stop the memory leak, though I do not know if what I did prevents true mining as I have not discovered a block since my testing of the change. 

In momentum.cpp around line 200 where the line "return results;" is I added 2 lines prior.

Code: [Select]
delete aesThreads;
delete sha512Threads;

I now have no memory leak, but wonder if I am still hashing properly.  I would think these lines are not necessary as boost should clean up but doing the above keeps my memory usage stable.  I am showing a good hash/min and CPU usage is high so it is doing something.

Since it looks like the code assumes the threads have completed by that point I think this is a safe operation.  However I am not a programmer so I am really just guessing.
Title: Re: Linux Crashes - new option -useevp=0
Post by: FreeTrade on December 19, 2013, 08:12:20 pm
Thanks for this. I can confirm adding those lines certainly won't do any harm.

If this clears up the memory leak, I'd like to put a big tip your way by way of thanks - please post your MC address.
Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 19, 2013, 08:41:56 pm
So far my tests look good.  After a few minutes of running it stabilized around 5752M of VIRT memory usage and after 45+ minutes of running it is still at 5752M.  Whereas before this would have crashed by 25 minutes and I was seeing over 1GB memory increases each minute. 

In fact occasionally I see the memory usage go down for a bit and then go back up to 5752M of memory, so really encouraging. 

Hopefully someone else can confirm that this helps them as well if they were encountering the memory leak.  I had been occasionally running into the corrupt database as well, not sure if this will help with that problem too.

But at least I can run for longer than 25 minutes at a time so I am happier.

Tips are always appreciated
DDNyYhXRSmGCedPHFSaPqZvCZJAyeGUWTw
Title: Re: Linux Crashes - new option -useevp=0
Post by: FreeTrade on December 19, 2013, 10:49:14 pm
People are reporting that this is helping -

https://bitsharestalk.org/index.php?topic=1449.msg16251#msg16251

Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 19, 2013, 11:25:42 pm
Awesome, it has definitely helped me tremendously.  I have not compiled your latest source that has other changes, I am still just running my modified copy.

But with those 2 simple changes I have been running for over 3 hours at this point with no memory increase beyond what happens in the first few minutes.  I pushed this out to my other machines and they are happy as well. 

Now I just wish it would find another block so I am confident it is working but that is a rare thing to encounter in such a short time. 
Title: Re: Linux Crashes - new option -useevp=0
Post by: FreeTrade on December 20, 2013, 01:00:47 pm

But at least I can run for longer than 25 minutes at a time so I am happier.

Tips are always appreciated
DDNyYhXRSmGCedPHFSaPqZvCZJAyeGUWTw

Glad to hear it. Have you a MC address?
Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 20, 2013, 02:55:05 pm
That was embarrassing, my correct address would be MMTkW4RDPqY63D6B9rLXWBQe8KdXKAZf8P

Also it is still running strong, no data corruption and no crashing.  Before I had a cron job to restart every 15 minutes, now it has ran no problem for over 18 hours.

I also found a block with it so I know it is working.
Title: Re: Linux Crashes - new option -useevp=0
Post by: FreeTrade on December 20, 2013, 05:30:34 pm
That was embarrassing, my correct address would be MMTkW4RDPqY63D6B9rLXWBQe8KdXKAZf8P

Also it is still running strong, no data corruption and no crashing.  Before I had a cron job to restart every 15 minutes, now it has ran no problem for over 18 hours.

I also found a block with it so I know it is working.

Thanks so much! 200 MMC on its way to you.
Title: Re: Linux Crashes - new option -useevp=0
Post by: pinwc4 on December 20, 2013, 06:14:29 pm
Received and appreciated.

Thanks