OLD | NEW |
1 # 2005 November 30 | 1 # 2005 November 30 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 sqlite3_memory_highwater 1 | 229 sqlite3_memory_highwater 1 |
230 execsql {SELECT * FROM abc} | 230 execsql {SELECT * FROM abc} |
231 set nMaxBytes [sqlite3_memory_highwater 1] | 231 set nMaxBytes [sqlite3_memory_highwater 1] |
232 puts -nonewline " (Highwater mark: $nMaxBytes) " | 232 puts -nonewline " (Highwater mark: $nMaxBytes) " |
233 expr $nMaxBytes > 1000000 | 233 expr $nMaxBytes > 1000000 |
234 } {1} | 234 } {1} |
235 do_test malloc5-4.2 { | 235 do_test malloc5-4.2 { |
236 db eval {PRAGMA cache_size=1} | 236 db eval {PRAGMA cache_size=1} |
237 db cache flush | 237 db cache flush |
238 sqlite3_release_memory | 238 sqlite3_release_memory |
239 sqlite3_soft_heap_limit 100000 | 239 sqlite3_soft_heap_limit 200000 |
240 sqlite3_memory_highwater 1 | 240 sqlite3_memory_highwater 1 |
241 execsql {SELECT * FROM abc} | 241 execsql {SELECT * FROM abc} |
242 set nMaxBytes [sqlite3_memory_highwater 1] | 242 set nMaxBytes [sqlite3_memory_highwater 1] |
243 puts -nonewline " (Highwater mark: $nMaxBytes) " | 243 puts -nonewline " (Highwater mark: $nMaxBytes) " |
244 expr $nMaxBytes <= 110000 | 244 expr $nMaxBytes <= 210000 |
245 } {1} | 245 } {1} |
246 do_test malloc5-4.3 { | 246 do_test malloc5-4.3 { |
247 # Check that the content of table abc is at least roughly as expected. | 247 # Check that the content of table abc is at least roughly as expected. |
248 execsql { | 248 execsql { |
249 SELECT count(*), sum(a), sum(b) FROM abc; | 249 SELECT count(*), sum(a), sum(b) FROM abc; |
250 } | 250 } |
251 } [list 10000 [expr int(10000.0 * 4999.5)] [expr int(10000.0 * 4999.5)]] | 251 } [list 10000 [expr int(10000.0 * 4999.5)] [expr int(10000.0 * 4999.5)]] |
252 | 252 |
253 # Restore the soft heap limit. | 253 # Restore the soft heap limit. |
254 sqlite3_soft_heap_limit $::soft_limit | 254 sqlite3_soft_heap_limit $::soft_limit |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 sqlite3_release_memory 31459 | 408 sqlite3_release_memory 31459 |
409 list [nPage db] [nPage db2] | 409 list [nPage db] [nPage db2] |
410 } {1 3} | 410 } {1 3} |
411 | 411 |
412 db2 close | 412 db2 close |
413 | 413 |
414 sqlite3_soft_heap_limit $::soft_limit | 414 sqlite3_soft_heap_limit $::soft_limit |
415 test_restore_config_pagecache | 415 test_restore_config_pagecache |
416 finish_test | 416 finish_test |
417 catch {db close} | 417 catch {db close} |
OLD | NEW |