我可以获取所有当前已注册原子的列表吗? [英] Can I get a list of all currently-registered atoms?

查看:70
本文介绍了我可以获取所有当前已注册原子的列表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目已经突破了100万个原子,我们已经提高了限制,但是我需要对人们提交的关于list_to_atom及其朋友的代码保持理智。首先,我想获得所有已注册原子的列表,以便了解罪犯人数最多的地方。有没有办法做到这一点。我将对如何执行操作具有创造力,这样我就不会最终尝试在实时控制台中转储1-2M行。

My project has blown through the max 1M atoms, we've cranked up the limit, but I need to apply some sanity to the code that people are submitting with regard to list_to_atom and its friends. I'd like to start by getting a list of all the registered atoms so I can see where the largest offenders are. Is there any way to do this. I'll have to be creative about how I do it so I don't end up trying to dump 1-2M lines in a live console.

推荐答案

我不确定是否可以在实时系统上执行此操作,但是如果可以在测试环境中运行它,则应该可以通过故障转储获取列表。原子表位于崩溃转储格式的结尾处。您可以通过 erlang:halt / 1 创建故障转储,但这会降低整个崩溃的速度。运行时系统。

I'm not sure if there's a way to do it on a live system, but if you can run it in a test environment you should be able to get a list via crash dump. The atom table is near the end of the crash dump format. You can create a crash dump via erlang:halt/1, but that will bring down the whole runtime system.

这篇关于我可以获取所有当前已注册原子的列表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆