93119a2588afc1810b9c6b819ce35cbb0a45bedc
angie
  Mon Jul 13 14:34:25 2020 -0700
bedToBigBed: add a -maxAlloc option to raise needLargeMem's ceiling for enormous bigDbSnp files.  refs #24500

diff --git src/hg/utils/automation/doBigDbSnp.pl src/hg/utils/automation/doBigDbSnp.pl
index 311f80a..e7be690 100755
--- src/hg/utils/automation/doBigDbSnp.pl
+++ src/hg/utils/automation/doBigDbSnp.pl
@@ -578,33 +578,36 @@
 done
 _EOF_
     ;
   close($fh);
   system("chmod a+x $makeSubsetsScript") == 0 || die "Unable to chmod $makeSubsetsScript";
 
   my $whatItDoes = "It runs bedToBigBed on merged & checked bigDbSnp files and makes ".
         "Mult, Common and ClinVar subsets.";
   my $bossScript = newBash HgRemoteScript("$runDir/doBigBed.sh", $workhorse,
                                           $runDir, $whatItDoes);
 
   $bossScript->add(<<_EOF_
 pids=""
 _EOF_
                   );
+  # Increase max memory allocation from default (on 64-bit machines) of 16GB (exceeded b154):
+  my $maxAlloc = 64 * 1024 * 1024 * 1024;
   foreach my $db (@dbList) {
     $bossScript->add(<<_EOF_
 time bedToBigBed -tab -as=\$HOME/kent/src/hg/lib/bigDbSnp.as -type=bed4+ -extraIndex=name \\
+            -maxAlloc=$maxAlloc \\
             $db.$outRoot.checked.bigDbSnp /hive/data/genomes/$db/chrom.sizes $db.$outRoot.bb &
 pids+=" \$!"
 time bedToBigBed -tab -type=bed4 -extraIndex=name \\
             $db.$outRoot.badCoords.bed /hive/data/genomes/$db/chrom.sizes $db.${outRoot}BadCoords.bb &
 pids+=" \$!"
 $makeSubsetsScript $db &
 pids+=" \$!"
 _EOF_
                     );
   }
   $bossScript->add(<<_EOF_
 for pid in \$pids; do
   if wait \$pid; then
     echo pid \$pid done
   else