sparkymat
sparkymat

Reputation: 10028

Will running an Android service in a different process, contribute to the same heap limit?

[Note: This is a followup to the question about running an Android service in a separate process: How can an Android application have more than one process?]

If I specify a service to run in a separate process, will it have its own heap limit (or does it share the heap limit with that the main process)? In short, are heap limits per-process or per-app?

Upvotes: 6

Views: 1332

Answers (1)

Franci Penov
Franci Penov

Reputation: 76001

Each process has own virtual memory and address space. Thus, each process also has own heap it manages itself.

However, all processes share the same physical memory, managed by the OS. Thus having a separate process can help with memory issues sometimes, but not always.

Upvotes: 5

Related Questions