24 May '13 - 23:44 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: BASS_ERROR_MEM  (Read 352 times)
Gorath
Posts: 63


« on: 9 Aug '12 - 12:48 »
Reply with quoteQuote

Hi,

my application creates streams with BASS_StreamCreateFileUser(STREAMFILE_BUFFER, BASS_STREAM_DECODE, procs, null); and it get BASS_ERROR_MEM when try to create handle for files with size ~170MB. So I checked memory usable and there should be enough free memory. Application takes ~800MB, total used memory in system is ~1.3GB. Total memory in system is 3.4GB (max. available on 32bit XP).
Any idea where could be the problem?
Logged
radio42
Posts: 4012


« Reply #1 on: 9 Aug '12 - 13:07 »
Reply with quoteQuote

A single process on XP can at max. use 2GB.
However, memory is managed in blocks by the operating system, as such memory might get fragmented over time, so the largest continuous memory block must be big enough to load the file data. As such it might happen, that there is no continuous memory block available to hold ~170MB?!
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #2 on: 9 Aug '12 - 17:59 »
Reply with quoteQuote

Are you getting the BASS_ERROR_MEM error right from the first BASS_StreamCreateFileUser call, or is it only after a number of streams have been created? If it's after a number of streams have been created, have the old streams been freed?
Logged
Gorath
Posts: 63


« Reply #3 on: 13 Aug '12 - 10:28 »
Reply with quoteQuote

Yeah, there is no continuous memory block to allocate ~170MB Sad I did some tests and if application's memory commit size is about 1GB it's almost impossible to allocate memory block ~200MB.

@Ian: It's not first call, there is problem only with large files (someone inserted raw-files to system) and all unused streams are freed.

So any idea how to use memory as cache or should I use temp files instead?
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #4 on: 13 Aug '12 - 14:09 »
Reply with quoteQuote

Is there a particular reason that you are using the STREAMFILE_BUFFER file system, eg. perhaps you are receiving the file from a remote source? If so, do you need to be able to seek, ie. use BASS_ChannelSetPosition? If not, you could use the BASS_STREAM_BLOCK flag to greatly reduce the amount of memory that's needed.
Logged
Gorath
Posts: 63


« Reply #5 on: 13 Aug '12 - 16:53 »
Reply with quoteQuote

Yes, in this case files are located at file servers. And I need to seek in files to set the start position, then no seek is required. BASS_STREAM_BLOCK option looks like good tip, but not in this case. There are another reasons why I need that file completely. I have already implemented cache for large files and it should be enough to solve this problem for now. Thanks for your time and tips.

G
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines