CoreStoreObject as struct? #332

Closed
opened 2025-12-29 15:29:18 +01:00 by adam · 2 comments
Owner

Originally created by @shift00 on GitHub (Jun 17, 2020).

Hi,
I need some help.
I want to operate with many objects from the database, for example (by steps):

  • save 100 objects as [MyDataModel],
  • read last 50 MyDataModel objects from the database,
  • change some property in each MyDataModel,
  • remove previously sent 50 MyDataModel objects from the database.

My problem is that MyDataModel inherits from CoreStoreObject and can't be structurally. After the stress test (saving 200+ objects in DB and sending (read/edit/delete) 400+ objects from DB in 1s) I have huge memory load.

Did anyone have a problem with dumping used entities?

Originally created by @shift00 on GitHub (Jun 17, 2020). Hi, I need some help. I want to operate with many objects from the database, for example (by steps): - save 100 objects as [MyDataModel], - read last 50 MyDataModel objects from the database, - change some property in each MyDataModel, - remove previously sent 50 MyDataModel objects from the database. My problem is that MyDataModel inherits from CoreStoreObject and can't be structurally. After the stress test (saving 200+ objects in DB and sending (read/edit/delete) 400+ objects from DB in 1s) I have huge memory load. Did anyone have a problem with dumping used entities?
adam closed this issue 2025-12-29 15:29:18 +01:00
Author
Owner

@Saklad5 commented on GitHub (Jun 17, 2020):

Model objects are fundamentally reference types rather than value types, as they reference an object in a context.

That isn’t the cause of the memory issue, though: you should make sure you aren’t referencing the objects after they are no longer needed.

@Saklad5 commented on GitHub (Jun 17, 2020): Model objects are fundamentally reference types rather than value types, as they _reference_ an object in a context. That isn’t the cause of the memory issue, though: you should make sure you aren’t referencing the objects after they are no longer needed.
Author
Owner

@shift00 commented on GitHub (Jun 22, 2020):

Solved.

@shift00 commented on GitHub (Jun 22, 2020): Solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#332