# MemoryLruGcSettings

# MemoryLruGcSettings


```
public final class MemoryLruGcSettings implements MemoryGarbageCollectorSettings
```

<br />

*** ** * ** ***

Configures the SDK to use a Least-Recently-Used garbage collector for memory cache.

To use, create an instance using `MemoryLruGcSettings#newBuilder().build()`, then set the instance to `MemoryCacheSettings.Builder#setGcSettings`, and use the built `
MemoryCacheSettings` instance to configure the Firestore SDK.

## Summary

| ### Nested types |
|---|
| `public class https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings.Builder` |

| ### Public fields |
|---|---|
| `long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#sizeBytes()` |

| ### Public methods |
|---|---|
| `boolean` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#equals(java.lang.Object)(https://developer.android.com/reference/kotlin/java/lang/Object.html o)` |
| `long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#getSizeBytes()()` Returns cache size threshold for the memory cache. |
| `int` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#hashCode()()` |
| `static @https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings.Builder` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#newBuilder()()` Returns a new instance of `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings.Builder` with default configurations. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings#toString()()` |

## Public fields

### sizeBytes

```
public long sizeBytes
```

## Public methods

### equals

```
public boolean equals(Object o)
```

### getSizeBytes

```
public long getSizeBytes()
```

Returns cache size threshold for the memory cache. If the cache grows beyond this size, Firestore SDK will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.

By default, memory LRU cache is enabled with a cache size of 100MB (100 \* 1024 \* 1024). The minimum value is 1 MB (1024 \* 1024).

### hashCode

```
public int hashCode()
```

### newBuilder

```
public static @NonNull MemoryLruGcSettings.Builder newBuilder()
```

Returns a new instance of `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/MemoryLruGcSettings.Builder` with default configurations.

### toString

```
public @NonNull String toString()
```