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

[fix/fp-memory] Reduce FP memory consumption #1387

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions ownCloud File Provider/FileProviderExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#import "NSError+MessageResolution.h"
#import "FileProviderServiceSource.h"
#import "FileProviderContentEnumerator.h"
#import <CrashReporter.h>

@interface FileProviderExtension ()
{
Expand All @@ -62,8 +61,6 @@ @implementation FileProviderExtension

- (instancetype)init
{
[self setupCrashReporting];

[OCLogger logLevel]; // Make sure +logLevel is called in File Provider, to properly set up the log level

NSDictionary *bundleInfoDict = [[NSBundle bundleForClass:[FileProviderExtension class]] infoDictionary];
Expand Down Expand Up @@ -107,37 +104,6 @@ - (OCVFSCore *)vfsCore
return (_vfsCore);
}

- (void)setupCrashReporting {

static dispatch_once_t token;

dispatch_once (&token, ^{
// Initialize crash reporter as soon as FP extension is loaded into memory
PLCrashReporterConfig *configuration = [PLCrashReporterConfig defaultConfiguration];
PLCrashReporter *reporter = [[PLCrashReporter alloc] initWithConfiguration:configuration];

// Do we have a pending crash report from previous session?
if ([reporter hasPendingCrashReport]) {

// Generate a report and add it to the log file
NSData *crashData = [reporter loadPendingCrashReportData];
if (crashData != nil) {
PLCrashReport *report = [[PLCrashReport alloc] initWithData:crashData error:nil];
if (report != nil) {
NSString *crashString = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
OCTLogError(@[@"CRASH_REPORTER"], @"%@", crashString);
}
}

// Purge the report which we just added to the log
[reporter purgePendingCrashReport];
}

// Start intercepting OS signals to catch crashes
[reporter enableCrashReporter];
});
}

- (void)dealloc
{
OCLogDebug(@"Deallocating FileProvider %@", self);
Expand Down
2 changes: 0 additions & 2 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
025FC745247EF0F1009307A7 /* BackgroundUploadsSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025FC744247EF0F1009307A7 /* BackgroundUploadsSettingsSection.swift */; };
02633EFF2483D2EB00B5F58F /* UNUserNotificationCenter+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02633EFE2483D2EB00B5F58F /* UNUserNotificationCenter+Extensions.swift */; };
0287DD7D249131E000C912CA /* AppStatistics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0287DD7C249131E000C912CA /* AppStatistics.swift */; };
02AE32E424D2FA8B00A19476 /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 02AE32E324D2FA8B00A19476 /* CrashReporter */; };
02D4C82A255208E60000E299 /* PDFSearchResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02D4C829255208E60000E299 /* PDFSearchResultsView.swift */; };
02DC7C9024CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DC7C8F24CB354800DCB2C6 /* ProPhotoUploadSettingsSection.swift */; };
232F7CAF2097260400EE22E4 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232F7CAE2097260400EE22E4 /* SettingsViewController.swift */; };
Expand Down Expand Up @@ -1782,7 +1781,6 @@
files = (
DC27A18F20CAA0BA008ACB6C /* ownCloudSDK.framework in Frameworks */,
DC1251EC2C74718B0040FBC6 /* libzip.framework in Frameworks */,
02AE32E424D2FA8B00A19476 /* CrashReporter in Frameworks */,
DC2565EE225F5A1900828AA5 /* UserNotifications.framework in Frameworks */,
DC973BBE24A28ED0001DEEC4 /* CoreServices.framework in Frameworks */,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
launchAutomaticallySubstyle = "2"
queueDebuggingEnabled = "No">
<RemoteRunnable
runnableDebuggingMode = "1"
runnableDebuggingMode = "0"
BundleIdentifier = "com.apple.DocumentsApp"
RemotePath = "/Library/Developer/CoreSimulator/Volumes/iOS_21A342/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Applications/Files.app">
RemotePath = "/var/containers/Bundle/Application/28D363B8-FA41-4A9B-97F8-5007F7EB81CC/Files.app">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
Expand Down Expand Up @@ -162,18 +163,6 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "MallocStackLogging"
value = ""
isEnabled = "YES">
</AdditionalOption>
<AdditionalOption
key = "PrefersMallocStackLoggingLite"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -183,16 +172,11 @@
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "233BDE9B204FEFE500C06732"
BuildableName = "ownCloud.app"
BlueprintName = "ownCloud"
ReferencedContainer = "container:ownCloud.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<RemoteRunnable
runnableDebuggingMode = "1"
BundleIdentifier = "com.apple.DocumentsApp"
RemotePath = "/Library/Developer/CoreSimulator/Volumes/iOS_22A3351/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.0.simruntime/Contents/Resources/RuntimeRoot/Applications/Files.app">
</RemoteRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Loading