如题 好像 v8 引擎对js的变量有内存限制 这个要如何不让它限制呢最好从代码的角度来修改
@malphi 不是的 贴下代码
function load_file_edu(file_edu, cb) {
var file_path = writeDir + generate_file_map['edu_school_dict'];
// var file_path = writeDir + "test.json";
fs.exists(file_path, function (exist) {
if (exist != true) {
//直接获取
// edu_school_dict = fs.readFileSync(file_path, “utf8”); // edu_school_dict = require(file_path); // console.log(edu_school_dict); cb(null, null); } else { //分析保存 readLine(file_edu).go(function (line, next) { var items = php.explode("\001", line); var cv_id = items[0]; var shool_id = (items[1] == undefined || items[1] == ‘’) ? 0 : items[1]; var major_id = (items[2] == undefined || items[2] == ‘’) ? 0 : items[2];
if (!shool_id && !major_id) {
next();
}
if (shool_id) {
if (edu_school_dict['school'] == undefined) {
edu_school_dict['school'] = {};
}
if (edu_school_dict['school'][cv_id] == undefined) {
edu_school_dict['school'][cv_id] = {};
if (edu_school_dict['school'][cv_id][shool_id] == undefined) {
edu_school_dict['school'][cv_id][shool_id] = shool_id;
}
} else {
if (edu_school_dict['school'][cv_id][shool_id] == undefined) {
edu_school_dict['school'][cv_id][shool_id] = shool_id;
} else {
edu_school_dict['school'][cv_id][shool_id] = shool_id;
}
}
}
if (major_id) {
if (edu_school_dict['majors'] == undefined) {
edu_school_dict['majors'] = {};
}
if (edu_school_dict['majors'][cv_id] == undefined) {
edu_school_dict['majors'][cv_id] = {};
if (edu_school_dict['majors'][cv_id][major_id] == undefined) {
edu_school_dict['majors'][cv_id][major_id] = major_id;
}
} else {
if (edu_school_dict['majors'][cv_id][major_id] == undefined) {
edu_school_dict['majors'][cv_id][major_id] = major_id;
} else {
edu_school_dict['majors'][cv_id][major_id] = major_id;
}
}
}
// console.log(edu_school_dict); next(); }, function () { console.log(edu_school_dict[‘majors’][12938664]); cb(null, null); });
}
});
}