Skip to content

Commit

Permalink
don't try to run the full vpx tests if the system has less than 2GB o…
Browse files Browse the repository at this point in the history
…f ram

git-svn-id: https://xpra.org/svn/Xpra/trunk@10508 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 31, 2015
1 parent cf58de1 commit 7b67555
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/xpra/codecs/vpx/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,18 @@ def selftest(full=False):
global CODECS
CODECS = testencoder(encoder, full)
#this is expensive, so don't run it unless "full" is set:
if full and os.name=="posix":
#but first, try to figure out if we have enough memory to do this
import subprocess
p = subprocess.Popen("free -b | grep ^Mem:", shell=True, stdout=subprocess.PIPE)
stdout = p.communicate()[0]
out = stdout.decode('utf-8')
freemem_MB = int(out.split(" ")[-1])//1024//1024
if freemem_MB<2048:
log.info("system has only %iMB of memory available, skipping vpx max-size tests", freemem_MB)
full = False
else:
log.info("system has %.1fGB of memory available, running full tests", freemem_MB/1024.0)
if full:
global MAX_SIZE
for encoding in get_encodings():
Expand Down

0 comments on commit 7b67555

Please sign in to comment.