MemoryError binary data storage

0 votes
I'm trying to to store about 350MB of binary data to peewee.BlobField but it is showing a MemoryError. I have no issues with smaller files like 250MB. How can I store 350MB?

This is how I am trying to store data:

Subproducts.create(cfg_id=config_id,
                   c=c,
                   mf=mf_data.getbuffer()
type(mf_data) is <class '_io.BytesIO'>

This is how my model looks like:

class Subproducts(BaseModel):

    cfg = peewee.ForeignKeyField(ConfigModel, related_name='cfg')
    c = peewee.TextField()
    mf = peewee.BlobField()

    class Meta:
        indexes = (
            (('cfg', 'c'), True),
        )
Dec 26, 2018 in Python by ana1504.k
• 7,910 points
804 views

1 answer to this question.

0 votes
The problem occurs when you are using 32bit Python but it is resolved with the help of 64bit Python.
answered Dec 26, 2018 by SDeb
• 13,300 points

Related Questions In Python

+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
15,277 views
0 votes
1 answer

Unique identification for data items in Python

Try the UUID module of Python. For example, ...READ MORE

answered Apr 17, 2018 in Python by Nietzsche's daemon
• 4,260 points
1,150 views
0 votes
1 answer

Need help with searching a binary search tree

Instead of multiplying the number of nodes ...READ MORE

answered Apr 17, 2018 in Python by anonymous
874 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

answered Nov 27, 2018 in Python by Rupali
29,709 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
0 votes
1 answer

Read & write data in mifare card

Hi, you can check out the following ...READ MORE

answered Nov 29, 2018 in Python by SDeb
• 13,300 points
2,090 views
0 votes
1 answer

Get bbox in data coordinates in matplotlib

I'm not sure how you got the ...READ MORE

answered Jun 18, 2019 in Python by SDeb
• 13,300 points
4,789 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP