Author Topic: std::bad_alloc Error  (Read 4792 times)

apredeus

  • Newbie
  • *
  • Posts: 1
std::bad_alloc Error
« on: February 28, 2013, 11:44:02 AM »
Hi guys,

I just wanted to let you know that I've encountered a strange error that I can't seem to explain; it seems to appear at random. Considering the nature of the error, I thought it might be a memory leak or some such thing?

The command I'm issuing is

bedmap --ec --delim '\t' --echo --bases 5000.mm9_lexisorted_windows.bed  alignment.bed > output

both BED files are sorted alphabetically. 

I'm running it on a cluster, giving the command 48Gb of memory and the whole node to use.

sjn

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: std::bad_alloc Error
« Reply #1 on: February 28, 2013, 12:01:18 PM »
Thanks for joining the forum.

bedmap should consume very little memory so this is definitely unexpected behavior. It sounds like you've met the requirements for inputs, and you're using --ec to be sure.

Could you report the version of bedmap you're using, please?  bedmap --help will show the version number near the top.

We sometimes find cases where input files are formatted using Windows newlines.  --ec should be able to pick that up as well though.  Would it be possible for you to post these files for download so we can take a close look?

Update: I've run the same sequence  of commands you show above using 30 GB inputs without issue.  bedmap will read into memory up to a chromsome's worth of data in the odd event that everything on that chromosome in your second file overlaps 1 entry in the first (reference) file.  Even in this very odd scenario, there shouldn't be any way to exhaust the memory you've allocated.  Under typical uses, you should only see memory running at perhaps 30 MB.  We're very interested in following up on this potential issue if we can.
« Last Edit: February 28, 2013, 01:14:46 PM by sjn »