Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Notification Service Extension (RESOURCE_TYPE_MEMORY) #8606

Closed
devssun opened this issue May 27, 2024 · 5 comments
Closed

Crash on Notification Service Extension (RESOURCE_TYPE_MEMORY) #8606

devssun opened this issue May 27, 2024 · 5 comments

Comments

@devssun
Copy link

devssun commented May 27, 2024

How frequently does the bug occur?

Always

Description

My Test Information
iPhone 11, iOS 17.5.1

In our application, we save push information at notification service extension(NSE).
I made project using Tuist. After apply Tuist, RealmSwift occured error when I called tryRealm() from NSE.

the error is
Thread 2: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=24 MB)
스크린샷 2024-05-27 오후 5 55 57

stacktrace
스크린샷 2024-05-27 오후 5 56 02

I don't understand what happened. please help me.

Stacktrace & log output

Thread 2 Queue : com.apple.NSXPCConnection.user.endpoint (serial)
#5	0x0000000107a8b07c in +[RLMSchema sharedSchema] at /Library/Developer/Xcode/DerivedData/efygztealpifkhargabzepbdapti/SourcePackages/checkouts/realm-cocoa/Realm/RLMSchema.mm:262
#6	0x0000000107a64b28 in +[RLMRealm realmWithConfiguration:queue:error:] at /Library/Developer/Xcode/DerivedData/efygztealpifkhargabzepbdapti/SourcePackages/checkouts/realm-cocoa/Realm/RLMRealm.mm:465
#8	0x0000000107b2a3c4 in Realm.init(configuration:queue:) at /Library/Developer/Xcode/DerivedData/efygztealpifkhargabzepbdapti/SourcePackages/checkouts/realm-cocoa/RealmSwift/Realm.swift:92
#9	0x0000000107b2a600 in Realm.init(fileURL:) at /Library/Developer/Xcode/DerivedData/efygztealpifkhargabzepbdapti/SourcePackages/checkouts/realm-cocoa/RealmSwift/Realm.swift:106


---
Thread 2: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=24 MB)

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

10.7.4

What Atlas Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

iOS 17.5.1

Build environment

Xcode version: 15.2
Dependency manager and version: SPM

Copy link

sync-by-unito bot commented May 27, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2372

@nirinchev
Copy link
Member

Can you try to explicitly specify the objectTypes in your realm config? That way you can avoid the costly reflection that's needed to build the default schema.

@devssun
Copy link
Author

devssun commented May 28, 2024

I already defined. This error does not occur in projects where Tuist is not applied. Could settings in the build settings possibly affect this?

public class History: Object {
    @objc public dynamic var _id = ObjectId.generate()
    @objc public dynamic var id: String?
    @objc public dynamic var date: Date = Date()
    @objc public dynamic var read: Bool = false
    @objc public dynamic var dataString: String?
}

@nirinchev
Copy link
Member

What do you mean by "I already defined"? The stacktrace seems to indicate that no objectTypes was specified on the realm configuration, which is why we're trying to use reflection to discover the default schema.

@devssun
Copy link
Author

devssun commented May 29, 2024

oops I'm sorry. I misunderstand and fix this issue. thank you.

@devssun devssun closed this as completed May 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants