Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Memory Leak Health Check
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Andrew Duncan
May 10, 2015
Technology
580
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Memory Leak Health Check
Andrew Duncan
May 10, 2015
More Decks by Andrew Duncan
See All by Andrew Duncan
Using Ext JS 6 for Mobile Development
andrewmduncan
0
150
Scot-Cloud 15 - Using Cloud as an enabler for Web/Mobile
andrewmduncan
0
66
Succeeding with Sencha Development
andrewmduncan
0
69
Securing Client-Side Data
andrewmduncan
0
150
Strategies for Working with Offline Data
andrewmduncan
1
170
Other Decks in Technology
See All in Technology
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
1
360
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
550
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
170
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.5k
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
3
630
Kiro Ambassador を目指す話
k_adachi_01
0
110
データサイエンスを価値につなげるプロジェクト設計 〜 DS一年目が現場で得た気づき 〜
ysd113
1
290
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
160
【2026年版】 ベクトル検索とEmbedding最前線
mocobeta
23
6.1k
入門!AWS Blocks
ysuzuki
1
170
SONiCの統計情報を取得したい
sonic
0
240
SteampipeとExcel Power QueryでAWS構成定義書の作成を自動化する
jhashimoto
0
160
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
New Earth Scene 8
popppiees
3
2.3k
Thoughts on Productivity
jonyablonski
76
5.2k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
390
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Mobile First: as difficult as doing things right
swwweet
225
10k
Mind Mapping
helmedeiros
PRO
1
260
Transcript
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