×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    28

    MemoryError inserting rows in db

    Hello. I made an script to insert rows into my db. All seems to work fine when small amount of rows are inserted. But, when I try to insert lot of them I get a "MemoryError" and all progress is avoided.

    I would like to know why this MemoryError happens. I don´t know if its because the db is too big (I doubt, it would be about 700-800Kb), the script is too long (I get the error when I try to insert more than 4.000 lines more or less), or whatever. My code is very simple, something like that.

    Any help or suggestion is welcome.

    Thanks

    PHP Code:
    import e32db
    db_name 
    u"C:\\Python\\test.db"
    try:
        
    db e32db.Dbms()
        
    db.open(db_name)
        
    db.execute(u"DELETE FROM test")
    except:
        
    db.create(db_name)
        
    db.open(db_name)
        
    db.execute(u"CREATE TABLE test (aaa VARCHAR, bbb VARCHAR, ccc INTEGER)")
    db.execute("INSERT INTO test (aaa, bbb, ccc) VALUES ('%s','%s', %d)"%(u"ola"u"hola"1))
    ##MORE AND MORE INSERTS
    db.compact()
    db.close() 

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Smile Re: MemoryError inserting rows in db

    Quote Originally Posted by totetote View Post
    Any help or suggestion is welcome.
    Which device do you use to run this script?

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    28

    Re: MemoryError inserting rows in db

    Quote Originally Posted by croozeus View Post
    Which device do you use to run this script?

    Best Regards,
    Croozeus
    I´m using Symbian OS Emulator.

    I made some new tests, and have a little more info.

    I have default config on emulator excepting Memory Capacity at 128MB (also tried default, 64MB, etc) I monitored mem usage while running the script and nothing strange happened. Mem Usage increases from 8.5MB idle to 25MB while script runs. Neither mem usage peak when MemoryError happens.

    It also creates a python_error.log file with following message:
    "no mem for next token".

    Complete error given in Python is this:

    PHP Code:
    Traceback (most recent call last):
    File "c:\private\2000b1a5\default.py"line 81in menu_action f()
     
    File "c:\private\2000b1a5\default.py"line 6in query_and_exec
      execfile
    (script_list[index][1].encode('utf-8'), script_namespace.namespace)
    MemoryError 
    UPDATE:

    I tried the same script in a nokia e65, and got the same MemoryError (faster this time)
    I tried a "lighter" script (that works OK in the emulator) with about 4000 rows, and phone gets crazy. First gets frozen, then it seems to autoreboot, and it creates the database, but only with the first 400-500 rows.

    Any info about physical limits in DB is welcome too.

    Thx again for helping
    Last edited by totetote; 2008-06-09 at 15:39.

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    28

    Re: MemoryError inserting rows in db

    Noone had or solved any problem during massive operations against database?

Similar Threads

  1. Inserting rows into CommDb
    By vikhyath in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-11-01, 22:36
  2. Replies: 3
    Last Post: 2006-08-15, 17:06
  3. Updating rows in RDbRowSet
    By roland.flury in forum Symbian
    Replies: 3
    Last Post: 2004-10-01, 04:07
  4. Replies: 3
    Last Post: 2003-07-16, 10:44
  5. Max rows on CAknDoubleStyleListBox?
    By petrikaikko in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-02-25, 09:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×