java gc停止 内存满_我们什么时候停止关心内存管理?
java gc停止 内存满
There's some amazing work happening over in the C#-based Kestrel web server. This is an little open source webserver that (currently) sits on libuv and lets you run ASP.NET web applications on Windows, Mac, or Linux. It was started by Louis DeJardin but more recently Ben Adams from Illyriad Games has become a primary committer, and obsessive optimizer.
基于C#的Kestrel Web服务器中发生了一些惊人的工作。 这是一个开源的小型Web服务器,当前位于libuv上,可让您在Windows,Mac或Linux上运行ASP.NET Web应用程序。 它由Louis DeJardin发起,但最近来自Illyriad Games的Ben Adams成为主要的提交者和强迫性优化器。
Kestrel is now doing 1.2 MILLION requests a second on benchmarking hardware (all published at https://github.com/aspnet/benchmarks) and it's written in C#. There's some amazing stuff going on in the code base with various micro-optimizations that management memory more intelligently.
Kestrel现在正在对基准测试硬件(均在https://github.com/aspnet/benchmarks上发布)进行每秒120万次请求,并使用C#编写。 代码库中发生了一些令人惊奇的事情,它们具有各种微优化,可以更智能地管理内存。
. @ben_a_adams I think it's safe to say you're on to something in that PR pic.twitter.com/ELIyxhYyun
— Damian Edwards (@DamianEdwards)。 @ben_a_adams我认为它是安全的,说你对某事的那个PR pic.twitter.com/ELIyxhYyun
— Damian Edwards(@DamianEdwards) December 23, 2015 ,2015年12月23日
Here's my question to you, Dear Reader, and I realize it will differ based on your language of choice:
亲爱的读者,这是我想问的问题,根据您选择的语言,我知道它会有所不同:
When did you stop caring about Memory Management, and is that a bad thing?
您什么时候停止关心内存管理的,这是一件坏事吗?
When I started school, although I had poked around in BASIC a bit, I learned x86 Assembler first, then C, then Java. We were taught intense memory management and learned on things like Minix, writing device drivers, before moving up the stack to garbage collected languages. Many years later I wrote a tiny operating system simulator in C# that simulated virtual memory vs physical memory, page faults, etc.
当我开始上学时,尽管我有点用BASIC摸索,但我还是先学习了x86汇编语言,然后学习了C和Java。 我们被教导进行严格的内存管理,并学习了诸如Minix ,编写设备驱动程序之类的知识,然后才将其上移至垃圾收集的语言。 多年后,我用C#编写了一个微型操作系统模拟器,用于模拟虚拟内存与物理内存,页面错误等。
There's a great reference here at Ravenbook (within their Memory Pool System docs) that lists popular languages and their memory management strategies. Let me pull this bit out about the C language:
Ravenbook在其“内存池系统”文档中有大量参考资料,列出了流行的语言及其内存管理策略。 让我讲一点有关C语言的知识:
The [C] language is notorious for fostering memory management bugs, including:
[C]语言因滋生内存管理错误而臭名昭著,其中包括:
- Accessing arrays with indexes that are out of bounds; 访问索引超出范围的数组;
Using stack-allocated structures beyond their lifetimes (see use after free);
Using heap-allocated structures after freeing them (see use after free);
Neglecting to free heap-allocated objects when they are no longer required (see memory leak);
当不再需要释放堆分配的对象时,忽略它们(请参阅内存泄漏);
Failing to allocate memory for a pointer before using it;
未能在使用指针之前为其分配内存;
- Allocating insufficient memory for the intended contents; 为所需的内容分配不足的内存;
- Loading from allocated memory before storing into it; 从分配的内存加载,然后再存储到内存中;
- Dereferencing non-pointers as if they were pointers. 取消引用非指针,就好像它们是指针一样。
When was the last time you thought about these things, assuming you're an application developer?
假设您是应用程序开发人员,您上一次考虑这些问题是什么时候?
I've met and spoken to a number of application developers who have never thought about memory management in 10 and 15 year long careers. Java and C# and other languages have completely hidden this aspect of software from them.
我遇到了许多应用程序开发人员,并与之交谈,他们从未考虑过10和15年职业生涯中的内存管理。 Java和C#及其他语言已完全从他们中隐藏了软件的这一方面。
BUT.
但。
They have performance issues. They don't profile their applications. And sometimes, just sometimes, they struggle to find out why their application is slow.
他们有性能问题。 他们没有描述他们的应用程序。 有时,只是有时,他们很难找出应用程序缓慢的原因。
My buddy Glenn Condron says you don't have to think about memory management until you totally have to think about memory management. He says "time spent sweating memory is time you're not writing your app. The hard part is developing the experience is that you need to know when you need to care."
我的好友Glenn Condron说,您不必完全考虑内存管理,而不必考虑内存管理。 他说:“花大量时间在记忆上的时间就是您不编写应用程序的时间。开发体验的难点在于您需要知道何时需要护理。”
I've talked about this a little in podcasts like the This Developer's Life episode on Abstractions with guests like Ward Cunningham, Charles Petzold, and Dan Bricklin as well as this post called Please Learn to Think about Abstractions.
我已经在播客中谈到了这一点,例如在Ward Cunningham , Charles Petzold和Dan Bricklin等来宾中,在Abstractions上的This Developer's Life一集中,以及这篇名为“请学习思考抽象”的帖子。
How low should we go? How useful is it to know about C-style memory management when you're a front-end JavaScript Developer? Should we make it functional then make it fast...but if it's fast enough, then just make it work? The tragedy here is that if it "works on my machine" then the developer never goes back to tighten the screws.
我们应该走多低? 当您是前端JavaScript开发人员时,了解C样式的内存管理有多有用? 我们是否应该使其功能正常,然后使其快速……但是,如果它足够快,则使其工作? 这里的悲剧是,如果它“在我的机器上工作”,那么开发人员将永远不会回去拧紧螺丝。
I propose it IS important but I also think it's important to know how a differential gear works, but that's a "because" argument. What do you think?
我认为这很重要,但我也认为了解差速器的工作原理很重要,但这是一个“因为”的论点。 你怎么看?
Sponsor: Big thanks to Infragistics for sponsoring the blog this week! Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls. Get super-charged performance with the world’s fastest HTML5 Grid - Download for free now!
赞助商:非常感谢Infragistics本周赞助了该博客! 带有Infragistics jQuery / HTML5控件的任何浏览器,任何平台和任何设备上的响应式Web设计。 借助世界上最快HTML5网格获得超级充电的性能-立即免费下载!
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。
翻译自: https://www.hanselman.com/blog/when-did-we-stop-caring-about-memory-management
java gc停止 内存满