Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Memory Leak Health Check
Search
Andrew Duncan
May 10, 2015
Technology
590
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Memory Leak Health Check
Andrew Duncan
May 10, 2015
Transcript
27 slides
Andrew Duncan Managing Director, SwarmOnline Member No. 149387 @andrewduncan
[email protected]
© 2015 SwarmOnline
1. Memory Management 2. Tools of the trade MEMORY LEAK
HEALTH CHECK Our Quest to Diagnose & Cure © 2015 SwarmOnline
WHY IS THIS TOPIC IMPORTANT? • Move to richer /
interactive applications • More use of JavaScript to achieve this • Single Page Applications • Cross integration of multiple frameworks and technologies • Multiple device types, operating systems and browsers © 2015 SwarmOnline
MEMORY LEAK DEFINITION mem . o . ry leak noun
COMPUTING noun: memory leak; plural noun: memory leaks a failure in a program to release discarded memory, causing impaired performance or failure. © 2015 SwarmOnline
YES • Garbage Collection NO • Coding Mishaps DOESN’T THIS
GET HANDLED FOR ME? © 2015 SwarmOnline
WHAT TOOLS DO WE HAVE © 2015 SwarmOnline
CHROME & DEVELOPER TOOLS •Task Manager •Timeline •Profiles © 2015
SwarmOnline
TASK MANAGER © 2015 SwarmOnline
•1st round of testing •Instantaneous view of memory •Useful for
monitoring changes over small periods of time TASK MANAGER © 2015 SwarmOnline
TIMELINE © 2015 SwarmOnline
• Monitors memory over time • Sudden drops === GC
• Look out for two things: • Steady rise in the chart • GC not returning to original memory usage TIMELINE © 2015 SwarmOnline
PROFILES © 2015 SwarmOnline
PROFILES •Identify increase in objects •Do comparison © 2015 SwarmOnline
RECORD HEAP ALLOCATIONS © 2015 SwarmOnline
RECORD HEAP ALLOCATIONS © 2015 SwarmOnline
N.B. • Memory is skewed just by having Chrome Developer
Tools open • Observer Effect © 2015 SwarmOnline
OTHER BROWSER TOOLS All of these browsers have tools that
can be used to monitor memory • Internet Explorer • Safari • Firefox © 2015 SwarmOnline
INTERNET EXPLORER DEVELOPER TOOLS © 2015 SwarmOnline
SAFARI FOR DEVELOPERS © 2015 SwarmOnline
FIREFOX DEVELOPER © 2015 SwarmOnline
TASK MANAGER & WINDOWS TOOLS • Record memory usage in
Perfmon & PsTools (PsList) • Plot and view memory usage over time • In our case 1 hour, 24 hours, 1 week, 1 month PsTools PsList © 2015 SwarmOnline
TASK MANAGER & WINDOWS TOOLS Pipe data out to CSV
for charting © 2015 SwarmOnline
AUTOMATE MEMORY MONITORING How do we do this? • Virtual
Machines • Auto snapshot every X minutes • Reduce Observer Effect • Graph your results © 2015 SwarmOnline
HOW TO DO THIS YOURSELF • Strip it back to
basics • App in container only • Send data but don’t enable parsing • Add in the data package • If your app has multiple parsers for different types of data, enable each data packet individually • Gradually add in your controllers and view • Each view will need tested individually • Create your app with only one view enabled • We run over 30 VM’s with different versions of an app to get as much coverage as possible © 2015 SwarmOnline
HOW TO DO THIS YOURSELF (2) • If you suspect
something is going wrong • Take snapshot • Run code • Take snapshot • Review differences • Obviously new data (e.g. Ajax requests) are going to skew your results between snapshots © 2015 SwarmOnline
FINAL THOUGHTS • If all else fails… • Or in
extreme circumstances…rm -rf* © 2015 SwarmOnline
Andrew Duncan Managing Director, SwarmOnline @andrewduncan
[email protected]
© 2015 SwarmOnline
More Decks by Andrew Duncan
See All by Andrew Duncan
Using Ext JS 6 for Mobile Development
andrewmduncan
0
160
Scot-Cloud 15 - Using Cloud as an enabler for Web/Mobile
andrewmduncan
0
74
Succeeding with Sencha Development
andrewmduncan
0
76
Securing Client-Side Data
andrewmduncan
0
160
Strategies for Working with Offline Data
andrewmduncan
1
190
Other Decks in Technology
See All in Technology
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
210
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
1
730
「AIチャットからもできないの?」と言われたら ~業務アプリをMCP対応するときの認証・認可の勘所
oidfj
0
360
AWS Emulator を評価する: 手元で動く AWS の API の仕組み、始め方、確かめ方
inariku
PRO
1
730
田んぼの見回りをIoTで減らしたい!水位監視から電池駆動カメラまでの試行錯誤
itosoft
1
250
AIで実装が加速したのに、 なぜ私は仕事の大半で人と話し続けていたのか?
say_no_w
0
180
プロダクションコードにおける encoding/json から encoding/json/v2 へのスムーズな移行
sansantech
PRO
1
440
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
2
1.1k
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
370
SSFの現在地 ― CAEP/RISCからAI Identityへ
oidfj
0
460
小さなエージェントから始めてみよう!実践コンテキストエンジニアリング
iwamot
PRO
0
130
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
340
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
480
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
610
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
990
Un-Boring Meetings
codingconduct
0
500
Are puppies a ranking factor?
jonoalderson
2
4.2k
Speed Design
sergeychernyshev
33
2.2k