{"record":{"id":"c14fb632f81f9bb0","repo":"alibaba/arthas","slug":"sizelimit-must-be-greater-than-0","errorCode":null,"errorMessage":"sizeLimit must be greater than 0.","messagePattern":"sizeLimit must be greater than 0\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java","lineNumber":250,"sourceCode":"\n    private boolean hasSearchExpress() {\n        return !StringUtils.isEmpty(searchExpress);\n    }\n\n    static String validateSizeLimit(Integer sizeLimit) {\n        if (sizeLimit != null && sizeLimit.intValue() <= 0) {\n            return \"sizeLimit must be greater than 0.\";\n        }\n        return null;\n    }\n\n    /**\n     * 检查参数是否合法\n     */\n    private void checkArguments() {\n        String validateError = validateSizeLimit(sizeLimit);\n        if (validateError != null) {\n            throw new IllegalArgumentException(validateError);\n        }\n\n        // 检查d/p参数是否有i参数配套\n        if ((isDelete || isPlay) && null == index) {\n            throw new IllegalArgumentException(\"Time fragment index is expected, please type -i to specify\");\n        }\n\n        // 在t参数下class-pattern,method-pattern\n        if (isTimeTunnel) {\n            if (StringUtils.isEmpty(classPattern)) {\n                throw new IllegalArgumentException(\"Class-pattern is expected, please type the wildcard expression to match\");\n            }\n            if (StringUtils.isEmpty(methodPattern)) {\n                throw new IllegalArgumentException(\"Method-pattern is expected, please type the wildcard expression to match\");\n            }\n        }\n\n        // 一个参数都没有是不行滴","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelCommand.java#L232-L268","documentation":"Thrown by checkArguments() in the `tt` (time tunnel) command when the --sizeLimit option is non-null and <= 0. validateSizeLimit() returns this message and checkArguments() wraps it in IllegalArgumentException. sizeLimit controls how many time fragments the tunnel can record, so it must be a positive integer.","triggerScenarios":"Running `tt --sizeLimit 0` or `tt --sizeLimit -1` (e.g. `tt -t --class-pattern X --method-pattern Y --sizeLimit 0`).","commonSituations":"Passing 0 intending 'unlimited' (Arthas uses a positive integer, not 0, for limits); misconfigured scripting defaulting sizeLimit to 0; sign error.","solutions":["Set --sizeLimit to a positive integer (e.g. the default), or omit it to use the default.","If you want a large buffer, pass a large positive value rather than 0."],"exampleFix":"// before\ntt -t --class-pattern demo.MathGame --method-pattern prime --sizeLimit 0\n// after\ntt -t --class-pattern demo.MathGame --method-pattern prime --sizeLimit 1000","handlingStrategy":"validation","validationCode":"static String checkSizeLimit(Integer sizeLimit) {\n    return (sizeLimit != null && sizeLimit <= 0)\n        ? \"sizeLimit must be > 0\" : null;\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Pass a positive --sizeLimit or omit it for the default.","Do not use 0 to mean 'unlimited'."],"tags":["arthas","tt-command","input-validation","limit"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}