AB的数据库大小

Discussion in 'AmiBroker' started by ranyang, Mar 3, 2012.

  1. 限制为500000,是所有品种加起来总和吗?那这样一个数据库设置几个品种合适呢?
     
  2. 这个数字是哪里看到的?给个链接?

    下面是AB performance tunning tips
    http://www.amibroker.com/guide/x_performance.html

    下面是摘录AB方面的设置:(也回答了你的第二个问题)
    On AmiBroker settings level

    Avoid unnecesarily large "Number of bars" in File->Database Settings

    This is the most often mistake people make. For example I have seen 50000 entered into "Number of bars" entered for end-of-day database. This does not make sense because 50000 daily bars is 192 years!!! There is no data source that offers such history and entering that amount is waste of memory. You need to keep in mind that what ever you enter here forces AmiBroker to actually allocate memory for that many bars. Each data bar is 40 bytes. So if you enter 100000 bars, you will force AmiBroker to actually allocate 4MB of memory *per symbol*. It may not sound too much but AmiBroker keeps a cache of recently used data and if you have defined the cache that is 500 symbols large you will be able to hit 2GB of memory that way. So always look at what File->Database Settings dialog displays next to "Number of bars" field. It will display the number of days equivalent to entered number of bars and choosen base time interval. Make sure that you only enter resonable values and be aware that whatever you enter here has performance consequences. The consequences do not end with memory consumption alone, but also in speed. Processing more bars means more CPU time, especially considering the fact that while small amounts of data can be kept in on-chip CPU cache, large amounts can not. Now considering that on-chip cache is usually 10 (ten) times faster than regular memory you immediately realize that specifying too much bars here result in performance drop. Again: one bar is 40 bytes. For best performance, make sure that you don't exceed CPU on-chip cache size, so if your CPU has 4MB cache, for best performance it is strongly advised not to use more than 100000 bars in File->Database Settings.

    Decrease the size of in-memory cache, if you are using very large databases (>2GB in disk size)
    The "in-memory cache" size defined in Tools->Preferences, "Data" tab controls the number of symbols in the cache and maximum amount of memory consumed by the cache. While larger cache generally speeds up processing because data do not need to be read from disk and written back all the time, you may run out of memory on certain situations when your cache is too large, especially on 32-bit operating system that limits the available virtual memory per process to 2GB. To avoid running out of memory, go to Tools->Preferences, "Data" and decrease the size of in-memory cache. To set it to minimum, enter "11" (eleven) into "in-memory cache (max. symbols)".
    IMPORTANT: It is advised NOT to decrease the cache when your databases are relatively small (few hundred MB) as larger cache will speed up the access. Large cache is good thing as long as you do not run out of memory.
     
  3. 非常感谢,我是因为在导入沪深股票代码后,每次进去都会有一些股票k线丢失,需要重新下载,不知道出什么问题,还以为是在数据库大小上受到了限制
     
  4. yrn

    yrn

    请参考Yahoo Group

    #127569 “Database settings and the amount of data saved” 里面有对"hidden extra feature"的描述;
    #152543“max bars database settings understanding” 里面有T.J的建议;
     
  5. yrn

    yrn

    顺便说句,这个Tomasz太有个性了。