@@ -19,7 +19,7 @@ import { handleGlobalEventListener } from './coreHandlers/handleGlobalEvent';
19
19
import { handleHistorySpanListener } from './coreHandlers/handleHistory' ;
20
20
import { handleXhrSpanListener } from './coreHandlers/handleXhr' ;
21
21
import { setupPerformanceObserver } from './coreHandlers/performanceObserver' ;
22
- import { createMemoryEntry , createPerformanceEntries } from './createPerformanceEntry' ;
22
+ import { createPerformanceEntries } from './createPerformanceEntry' ;
23
23
import { createEventBuffer , EventBuffer } from './eventBuffer' ;
24
24
import { deleteSession } from './session/deleteSession' ;
25
25
import { getSession } from './session/getSession' ;
@@ -36,6 +36,7 @@ import type {
36
36
SendReplay ,
37
37
} from './types' ;
38
38
import { addEvent } from './util/addEvent' ;
39
+ import { addMemoryEntry } from './util/addMemoryEntry' ;
39
40
import { captureInternalException } from './util/captureInternalException' ;
40
41
import { createBreadcrumb } from './util/createBreadcrumb' ;
41
42
import { createPayload } from './util/createPayload' ;
@@ -701,23 +702,6 @@ export class ReplayContainer {
701
702
return createPerformanceSpans ( this , createPerformanceEntries ( entries ) ) ;
702
703
}
703
704
704
- /**
705
- * Create a "span" for the total amount of memory being used by JS objects
706
- * (including v8 internal objects).
707
- */
708
- addMemoryEntry ( ) : Promise < void [ ] > | undefined {
709
- // window.performance.memory is a non-standard API and doesn't work on all browsers
710
- // so we check before creating the event.
711
- if ( ! ( 'memory' in WINDOW . performance ) ) {
712
- return ;
713
- }
714
-
715
- return createPerformanceSpans ( this , [
716
- // @ts -ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
717
- createMemoryEntry ( WINDOW . performance . memory ) ,
718
- ] ) ;
719
- }
720
-
721
705
/**
722
706
* Checks if recording should be stopped due to user inactivity. Otherwise
723
707
* check if session is expired and create a new session if so. Triggers a new
@@ -819,7 +803,7 @@ export class ReplayContainer {
819
803
}
820
804
821
805
// Only attach memory event if eventBuffer is not empty
822
- await this . addMemoryEntry ( ) ;
806
+ await addMemoryEntry ( this ) ;
823
807
824
808
try {
825
809
// Note this empties the event buffer regardless of outcome of sending replay
0 commit comments