Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminate called after throwing an instance of 'std::bad_alloc' when asking for more memory than is available #9

Open
tmaklin opened this issue Oct 19, 2021 · 0 comments

Comments

@tmaklin
Copy link
Collaborator

tmaklin commented Oct 19, 2021

Hi,

Running build_index with --mem-megas higher than what is available on the machine (16000 in my example) will terminate with an uncaught std::bad_alloc exception. The output from an example run where this happens is the following text:

[temaklin@xps13 example]$ ~/Tools/themisto/build/bin/build_index -k31 --mem-megas 100000 --input-file example.fasta --index-dir index --temp-dir index/tmp
0.0270 Tue Oct 19 16:08:06 2021 Themisto-v1.1.0-3-ge591cd2
0.0270 Tue Oct 19 16:08:06 2021 Maximum k-mer length (size of the de Bruijn graph node labels): 60
Input file = example.fasta
Input format = fasta
Index directory = index
Temporary directory = index/tmp
k = 31
Number of threads = 1
Memory megabytes = 100000
Automatic colors = false
Load BOSS = false
Preprocessing buffer size = 4096
0.0280 Tue Oct 19 16:08:06 2021 Starting
0.0280 Tue Oct 19 16:08:06 2021 Making all characters upper case and replacing non-{A,C,G,T} characters with random characters from {A,C,G,T}
0.2280 Tue Oct 19 16:08:06 2021 Replaced 0 characters
0.2280 Tue Oct 19 16:08:06 2021 Building BOSS
0.2280 Tue Oct 19 16:08:06 2021 Building KMC database
Validating input alphabet
Calling KMC with: kmc -b -fm -k32 -m93 -ci1 -cs1 -cx4294967295 -t1 index/tmp/seqs-emQeceWVoPCgQwZvP0I7XacvO index/tmp/KMCmS1OFXxZcnrO6MakHmnMkZ7I1 index/tmp 
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
caught signal: 6
Cleaning up temporary files
Aborting

In other cases, where the call to build_index is somehow wrong, the exceptions are caught and Themisto gives more helpful error messages before terminating. Should this case in similar manner suggest to check the value of --mem-megas before terminating?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant