1. If you already own a license for XF1 add-ons and they are active, you can also use XF2 versions
    Dismiss Notice

Cannot reproduce Allowed memory size exhausted when browsing attachments

Discussion in 'Advanced Attachment System (AAS)' started by bodybuilding.nl, May 27, 2018.

  1. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    With the paperclip on thread lists this happens if there are a large amount of pages (+1000) or attachments.

    Code:
    ErrorException: Fatal Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes) - library/Zend/Db/Statement/Mysqli.php:304
    Gegenereerd Door: Onbekend Account, 16 minuten geleden
    Stack Trace #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}
    Aanvraagstatus array(3) {
      ["url"] => string(114) "https://forum.bodybuilding.nl/topics/master-of-magic-god-of-war-odin-wanders-alone.113806/attachments?simplePage=1"
      ["_GET"] => array(1) {
       ["simplePage"] => string(1) "1"
      }
      ["_POST"] => array(0) {
      }
    }
    
     
  2. au lait

    au lait Administrator Staff Member XenForo License

    I can't reproduce this!
    I have created over 2000 posts with 13 attachments each

    So I assume that PHP has too little memory available.
    Screen_20180528012609.png

    Screen_20180528012614.png
     
  3. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    I am thinking this has to do with the amount of attachments instead of pages. In the threads that give the error there are more then 500 attachments.
     
  4. au lait

    au lait Administrator Staff Member XenForo License

    I tested it with a Thrad there have 30k attachments
     
    bodybuilding.nl likes this.
  5. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    With what memory_limit set? If not higher then 256MB then it could be with some of my other settings.

    Code:
    [mysqld]
    performance-schema=0
    ignore_db_dirs=cmsetiofiotest
    local-infile=0
    ignore_db_dirs=lost+found
    
    innodb=ON
    back_log = 512
    max_connections = 100
    key_buffer_size = 256M
    myisam_sort_buffer_size = 256M
    myisam_max_sort_file_size = 2048M
    join_buffer_size = 256K
    read_buffer_size = 256K
    sort_buffer_size = 256K
    table_definition_cache = 8192
    table_open_cache = 4096
    thread_cache_size = 256
    wait_timeout = 1800
    connect_timeout = 10
    tmp_table_size = 256M
    max_heap_table_size = 256M
    max_allowed_packet=268435456
    max_seeks_for_key = 1000
    group_concat_max_len = 1024
    max_length_for_sort_data = 1024
    net_buffer_length = 16384
    max_connect_errors = 100000
    concurrent_insert = 2
    read_rnd_buffer_size = 512K
    bulk_insert_buffer_size = 8M
    query_cache_limit = 1024K
    query_cache_size = 80M
    query_cache_type = 1
    query_cache_min_res_unit = 2K
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = InnoDB
    
    
    innodb_large_prefix=1
    innodb_purge_threads = 4
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    innodb_open_files = 1000
    innodb_data_file_path= ibdata1:10M:autoextend
    innodb_buffer_pool_size = 8G
    
    innodb_buffer_pool_instances = 8
    
    innodb_log_files_in_group = 2
    innodb_log_file_size = 256M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 2
    innodb_lock_wait_timeout=50
    innodb_flush_method = O_DIRECT
    innodb_support_xa=1
    
    innodb_io_capacity = 600
    innodb_io_capacity_max = 1200
    innodb_read_io_threads = 4
    innodb_write_io_threads = 4
    
    open_files_limit=10000
    [mariadb]
    userstat = 0
    key_cache_segments = 1
    aria_group_commit = none
    aria_group_commit_interval = 0
    aria_log_file_size = 768M
    aria_log_purge_type = immediate
    aria_pagecache_buffer_size = 768M
    aria_sort_buffer_size = 192M
    
    [mariadb-5.5]
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    
    query_cache_strip_comments=0
    
    [mysqld_safe]
    socket          = /var/lib/mysql/mysql.sock
    open-files-limit = 8192
    
    [myisamchk]
    key_buffer = 256M
    sort_buffer = 32M
    read_buffer = 32M
    write_buffer = 32M
    
    [mysqlhotcopy]
    interactive-timeout
    
    [mariadb-10.0]
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    
    innodb_buffer_pool_populate=0
    performance_schema=OFF
    innodb_stats_on_metadata=OFF
    innodb_sort_buffer_size=2M
    innodb_online_alter_log_max_size=128M
    query_cache_strip_comments=0
    log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
    
     
  6. au lait

    au lait Administrator Staff Member XenForo License

    bodybuilding.nl likes this.
  7. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    Ok, thanx ;) Will increase the memory_limit.
     
    au lait likes this.
  8. au lait

    au lait Administrator Staff Member XenForo License

    Give me Feedback :)
     
    bodybuilding.nl likes this.
  9. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    Increased it to 300 and no more error ;)
     
    au lait likes this.
  10. bodybuilding.nl

    bodybuilding.nl Member XenForo License

    I also have a suggestion to set the paperclip links (simplepage) to nofollow. I have blocked those in robots.txt at the moment, no use letting bots crawl these i think.
     
    au lait likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice