Comments (10)
在1分的k线下,左右快速拖动,内存非常吃紧,达到500m,这个问题也是困扰我好久了
from yykline.
没法优化的,框架设计缺陷太大,数据处理和采用scrollView是最大的问题
只能重新设计
from yykline.
这个库如果接入websocket的话真的是坑翻天,每次获取新数据就要重新计算整个groupModel的数据,然后redraw当前屏幕所有数据,我马上要release了发现这个问题,真的把我坑的够呛。现在再去重构它已经来不及了,只能想办法优化一下,下个版本要弃用这个库了
from yykline.
用这个写的K线,内存消耗过大,各位大神有办法解决吗?
from yykline.
内存已经解决,没优化前,在分时线上,由于数据过大,可以到达1G闪退。要重构一下项目结构,把mainview ,volumeview ,accesorryView不要加到scrollView上,加到scrollView的父控件上,宽度一直保持不变,与scrollView的宽度相同(注意不是scrollView ContentSize的宽度)。
from yykline.
如果不能换框架的话,有个内存优化的方法,可以暂时缓解一下,就是把Y_KlineModel的属性修改下,如下图,但是也一样治标不治本,引用上一个model的方法简直奇葩,为什么不留个index?下面的groupModel可以改成weak,
model的实现里面:
- (Y_KLineModel *)PreviousKlineModel
{
Y_KLineModel *tempModel = nil;
// if (!_PreviousKlineModel) {
//// _PreviousKlineModel = [[Y_KLineModel alloc] init];
if (self.index >= 1) {
tempModel = [self.ParentGroupModel.models objectAtIndex:(self.index - 1)];
}else {
tempModel = [[Y_KLineModel alloc] init];
tempModel.DIF = @(0);
tempModel.DEA = @(0);
tempModel.MACD = @(0);
tempModel.MA7 = @(0);
tempModel.MA12 = @(0);
tempModel.MA26 = @(0);
tempModel.MA30 = @(0);
tempModel.EMA7 = @(0);
tempModel.EMA12 = @(0);
tempModel.EMA26 = @(0);
tempModel.EMA30 = @(0);
tempModel.Volume_MA7 = @(0);
tempModel.Volume_MA30 = @(0);
tempModel.Volume_EMA7 = @(0);
tempModel.Volume_EMA30 = @(0);
tempModel.SumOfLastClose = @(0);
tempModel.SumOfLastVolume = @(0);
tempModel.KDJ_K = @(50);
tempModel.KDJ_D = @(50);
tempModel.MA20 = @(0);
tempModel.BOLL_MD = @(0);
tempModel.BOLL_MB = @(0);
tempModel.BOLL_DN = @(0);
tempModel.BOLL_UP = @(0);
tempModel.BOLL_SUBMD_SUM = @(0);
tempModel.BOLL_SUBMD = @(0);
}
//
// }
return tempModel;
}
from yykline.
我也是,不过还好的是,我们的版本被拒了,我正好有时间重写了一个K线图,要不你看下我这个https://github.com/ghostlordstar/GLKLineKit ,还不太完善,不过比这个强多了,有时间还会再优化
from yykline.
from yykline.
现在内存在100m左右
from yykline.
from yykline.
Related Issues (20)
- RSI HOT 1
- Y_KLineModel 内存泄漏 HOT 10
- 如何加价格线? HOT 1
- 成交量不显示怎么办
- 不支持分页加载?一次性加载几千条数据有点卡,因为有各种指标的计算,每次加载300条数据,滑动到最左边然后继续加载 HOT 2
- 支持pod吗?
- Y_KLineVolumeView里bugly检测到偶尔数据越界
- 左右滚动,有时segmentView和kLinView间会出现空白
- 接口好像挂了,请求不到数据了 HOT 3
- 滑动到最左边没有加载左侧数据的代理吗?
- 分时情况下,时间横坐标是有问题的,不可能跨天 HOT 2
- 你好,请问k线图里面的副指标还有其他分类吗,比如rsi、 wr这之类的 HOT 1
- 新版本切换指标视图不刷新 HOT 1
- 您好请问能否同时展示多个副图指标? HOT 2
- 大神你好。因为有个几年前的项目用到您这个K线,想请教下 HOT 1
- 接口挂了。 HOT 1
- 支持初始数据的分页加载么ps ws推数据的问题
- Demo运行报错 HOT 2
- 测试数据源失效 HOT 1
- 牛眼行情的数据取不到了,哪个好心人可以提供一份json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yykline.