如何增加/proc/pid/cmdline 4096 字节限制? [英] How do I increase the /proc/pid/cmdline 4096 byte limit?

查看:28
本文介绍了如何增加/proc/pid/cmdline 4096 字节限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的类路径很长的 Java 应用程序,我在使用 ps 时看不到 arg 列表末尾附近指定的主类.我认为这源于我的 Ubuntu 系统对/proc/pid/cmdline 的大小限制.如何提高此限制?

For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit?

推荐答案

你不能动态改变这个,限制在内核中硬编码为 fs/proc/base.c 中的 PAGE_SIZE:

You can't change this dynamically, the limit is hard-coded in the kernel to PAGE_SIZE in fs/proc/base.c:

 274        int res = 0;
 275        unsigned int len;
 276        struct mm_struct *mm = get_task_mm(task);
 277        if (!mm)
 278                goto out;
 279        if (!mm->arg_end)
 280                goto out_mm;    /* Shh! No looking before we're done */
 281
 282        len = mm->arg_end - mm->arg_start;
 283 
 284        if (len > PAGE_SIZE)
 285                len = PAGE_SIZE;
 286 
 287        res = access_process_vm(task, mm->arg_start, buffer, len, 0);

这篇关于如何增加/proc/pid/cmdline 4096 字节限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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