1

I am working on Xamarin.Android application. In this application, I have local database. I am using sqlite.net plugin to manage sqlite operations.

While testing application on lower configuration, I found have memory consumption from application. while checking with Xamarin Profiler, I got to know that majority memory is allocated to one of database method [more than 50 %].

It is used in System.Linq.Enumerable:FirstofDefault<SQlite.TableMapping/Column>.

Can we manually deallocate this memory? is there any way? Can we release memory from application progrmattically?

I have tried with GC.Collect() but it is not useful.

If anyone have idea actual reason behind this issue?

Samir Bhatt
  • 3,041
  • 2
  • 25
  • 39
  • 1
    Generally methods that return a sequence use deferred execution .Here is a similar issue that maybe can help you .https://stackoverflow.com/questions/41875875/entity-framework-linq-functions-and-memory-usage – Lucas Zhang Sep 24 '20 at 12:02

1 Answers1

0

After doing some research, i found that we can use PRAGMAfunction to release memory.

We can call below query to release memory manually.

PRAGMA shrink_memory;
Samir Bhatt
  • 3,041
  • 2
  • 25
  • 39