We put excellence, value and quality above all - and it shows
A Technology Partnership That Goes Beyond Code
“Arbisoft has been my most trusted technology partner for now over 15 years. Arbisoft has very unique methods of recruiting and training, and the results demonstrate that. They have great teams, great positive attitudes and great communication.”
AdTech Integration Case Study: Avoiding Memory Leaks and Performance Pitfalls

When scaling digital products globally, choosing the right advertising technology partner becomes critical for both revenue generation and user experience. Our recent integration with a global AdTech provider initially seemed successful, particularly given their strong presence in China, where we have a significant user base. However, what started as a promising partnership later on revealed hidden technical debt that severely impacted our application's performance.
This case study examines how memory leaks in third party ad scripts can silently degrade user experience, the warning signs to watch for, and most importantly, how to evaluate AdTech providers to avoid these pitfalls altogether.

The Investigation
What started as isolated user complaints quickly revealed a systemic problem. Our engineering team dove deep and uncovered a digital mess that would make any developer cringe:
The Smoking Gun: Local Storage Explosion
The AdTech provider's client side scripts were essentially treating every user's browser like their personal database, with no janitor service.
// What we found in users' browsers:
_-1001280373: {"value":9,"created":1748528555584}
panorama_id_12847: {"zone_data":"...", "timestamp":1748528555584}
user_zone_china_8472: {"active":true, "created":1748528555584}
ad_frequency_cap_945: {"impressions":47, "last_reset":1748528555584}
// ...and hundreds more entries per session
The Perfect Storm:
- Hundreds of local storage entries created per user session
- Zero cleanup mechanisms for expired data
- Aggressive polling every 10-15 seconds (even when tabs were inactive)
- No exponential backoff for failed requests
- Memory consumption ballooning to 3-7GB in extended sessions

Your AdTech Evaluation Playbook
Here's what we learned the hard way, so you don't have to:
Technical Red Flags (Run If You See These)
During Evaluation:
- Vague documentation about performance impact
- Reluctance to discuss memory usage or polling strategies
- No sandbox environment for testing
- "One-size-fits-all" solutions with zero customization
Post-Integration:
- Mysterious performance degradation unrelated to your code changes
- Storage bloat in browsers
- Excessive network requests (>4 per minute are suspicious.)
- Console errors from third-party scripts
The Technical Due Diligence Checklist
Performance Deep Dive:
- Request memory benchmarks under various load conditions
- Test script behavior during 2+ hour sessions
- Compare app performance with/without their scripts
- Evaluate the impact on Core Web Vitals
Architecture Pattern Analysis
- Polling Strategy Assessment: Determine if the provider uses client-side or server-side polling
- Client-Side Polling Evaluation:
- Polling frequency and intervals (avoid aggressive polling < 30 seconds)
- Resource consumption patterns (CPU, memory, network)
- Exponential backoff implementation for failed requests
- Browser tab visibility awareness (pause polling when tab is inactive)
- Local caching strategies and cleanup mechanisms
- Server-Side Infrastructure Assessment:
- Server capacity and geographic distribution
- CDN coverage and edge server performance
- Rate limiting and DDoS protection capabilities
- API response times and SLA guarantees
- Failover and redundancy mechanisms

Regional Considerations:
- Performance testing across geographic regions (especially China)
- Data localization compliance
- CDN and infrastructure coverage in target markets
Defensive Programming Patterns
Smart Monitoring:
Check memory usage before critical app operations and show users a friendly "refresh for better performance" prompt when thresholds are exceeded—don't let apps crash silently when you can gracefully guide users to a solution.
function monitorMemoryUsage() {
if ('memory' in performance) {
const memInfo = performance.memory;
const memoryUsage = {
used: memInfo.usedJSHeapSize,
total: memInfo.totalJSHeapSize,
limit: memInfo.jsHeapSizeLimit
};
if (memoryUsage.used > MEMORY_THRESHOLD) {
reportPerformanceIssue('high_memory_usage', memoryUsage);
}
}
}
Intelligent Polling (If You Must Build It Yourself):
Ask your AdTech provider upfront what polling strategy they use and demand visibility-aware, exponential backoff implementations—if they can't answer or their approach is aggressive, implement your own polling wrapper with tab detection and reasonable intervals (never <30 seconds) to protect your users' resources.
class AdPollingManager {
constructor(baseInterval = 60000) { // Start with 1-minute intervals
this.baseInterval = baseInterval;
this.isVisible = !document.hidden;
this.consecutiveFailures = 0;
this.initVisibilityListener();
}
initVisibilityListener() {
document.addEventListener('visibilitychange', () => {
this.isVisible = !document.hidden;
if (this.isVisible) {
this.startPolling();
} else {
this.pausePolling(); // Critical: Stop when tab is inactive
}
});
}
calculateBackoffInterval() {
// Exponential backoff: 1min → 2min → 4min → max 15min
return Math.min(
this.baseInterval * Math.pow(2, this.consecutiveFailures),
900000
);
}
}
Essential Safeguards:
- Iframe sandboxing for untrusted scripts
- Performance budgets with automatic fallbacks
- Regular cleanup of third-party data
- Comprehensive load testing with extended sessions
The Resolution
Immediate Fixes:
- Isolated problematic scripts in sandboxed iframes
- Implemented aggressive cleanup of accumulated ad data
- Enhanced real-time performance monitoring
- Provided user workarounds while planning migration
Strategic Changes:
- Migrated to a technically superior AdTech provider
- Established performance SLAs for all third-party integrations
- Created comprehensive evaluation frameworks for future vendors
Results:
- 70% reduction in memory consumption
- Big decrease in performance-related support tickets
- Core Web Vitals scores improved across all regions
- No more 7GB browser tabs
The Bottom Line
For Engineers
Technical due diligence isn't optional. Performance monitoring should be implemented before integration, not after users start complaining. Memory leaks from third-party scripts are more common than you think.
For Product Teams
The cheapest AdTech solution is rarely the most cost-effective when you factor in engineering overhead and user churn. Technical evaluation should carry equal weight with business metrics.
For Decision Makers
User experience degradation can quickly offset advertising revenue gains. Invest in proper evaluation processes upfront—the cost of remediation far exceeds the investment in doing it right the first time.

Final Thoughts
AdTech integration isn't just about revenue—it's about balancing monetization with user experience. The providers who understand this balance and prioritize technical excellence alongside business results are the ones worth partnering with.
The next time an AdTech provider promises the world but can't explain their polling strategy or memory management approach, remember our 7GB browser tabs and run the other way.
Have you encountered similar AdTech integration challenges? What warning signs did you miss? Share your war stories—we've all been there.